Overview
Follow these steps to implement Dynamic Ads.txt for your site or application. The entire ads.txt file must be placed on production at least a week prior to your site launch.
Ads.txt Crawler Identification
Our automated system regularly fetches your Ads.txt file to ensure it remains up to date. If your website is protected by a firewall, security plugin, or other traffic-filtering rules, your ads.txt allowlist needs to be updated. Follow the documentation included here to make the necessary updates.
Installation
Site
Install a redirect to the Freestar-hosted ads.txt file at the root domain.
You can locate the Ads.txt file by logging into publisher.freestar.io and navigating to Site Configuration > Ads.txt
App
Install a redirect to the Freestar-hosted App-ads.txt file at the root level of your app developer domain.
The App-ads.txt file can be found by logging into publisher.freestar.io and navigating to Site Configuration > App Ads.txt.
Additional Instructions
Jump to more detailed instructions based on your site or app configuration:
Apache Http Server
- You can set up the site by selecting the "Apache .htaccess" option in the "Copy Redirect" menu.
- If your site does not have an .htaccess file:
- Create a text file and paste the copied text in the first line.
- Name the text file .htaccess
- Login to your server via FTP/SFTP or whatever method you use to upload files to your server.
- Upload the file to the root directory.
- If your site already has an .htaccess file:
- Using your preferred method of editing files on your server open the existing .htaccess file
- Insert the copied text into the first line of the .htaccess file. The text should be on its own line.
- Save the file.
- To verify that it was uploaded to the correct spot, you should be able to navigate to https://yourdomain.com/ads.txt> and verify that the URL redirects to a.pub.network.
NginX Http Server
- You can set up a site by selecting the "NginX .conf" option in the "Copy Redirect" menu.
- Open the existing .conf file (usually found in /etc/nginx/) using your preferred method of editing files on your server.
- Insert the copied text into the server block of your domain configuration and save the file.
- To verify that it was uploaded to the correct spot, you should be able to navigate to https://yourdomain.com/ads.txt> and verify that the URL redirects to a.pub.network.
Cloudflare
- Log into your Cloudflare account.
- Click the appropriate Cloudflare account for the domain where you want to add URL forwarding.
- Click the Page Rules app.
- Under Page Rules, click Create Page Rule. The Create Page Rule for dialog opens.
- Under If the URL matches, enter /ads.txt
- Next, click Add a Setting.
- Choose Forwarding URL from the drop-down menu.
- Click Select Status Code and choose 301 (Permanent Redirect)
- In the destination URL field, enter the URL for the FS Ads.txt page corresponding to your domain.
- To finish, click Save and Deploy.
- To verify that it was uploaded to the correct spot, you should be able to navigate to https://yourdomain.com/ads.txt> and verify that the URL redirects to a.pub.network.
Please review the Cloudflare documentation for more information on configuring a redirect using Cloudflare Page Rules.
WP Engine
While WP Engine sites may have a .htaccess file, there is an easier solution built in the WP Engine admin that you can use.
- Login to my.wpengine.com.
- Navigate to the "Sites" section.
- Click on the site you want to apply the redirect rule to.
- Under the Production environment on the left rail, select "Redirect Rules".
- At the top, right-click on "New Redirect Rule".
- You will see a dialogue pop up for more information.
- Open a new tab/window and open up the Freestar Dashboard and then navigate to the Site Configuration tab.
- Click on the Contextual Menu ("...") to the right of the domain you are working on, and select the "Copy Apache redirect" option.
- Head back to the WP Engine page and now you will fill in the details.
- Redirect Name: Provide something here like "ads.txt" that indicates where it's redirecting to
- Domain: Be sure to select the domain you are on to avoid redirecting all domains to the same file
- Source: This will be /ads.txt
- Destination: This will be where you are redirecting to the Freestar ads.txt file, i.e., https://a.pub.network/yourdomain-com/ads.txt
- There isn't anything required under the advanced settings, you can save this after you've filled out the above fields
- That's it. Now, you should see a redirect if you visit yourdomain.com/ads.txt.
Firebase
Update your Firebase config accordingly:
See Firebase Redirects Docs for further info.
Manual Installation
This product works by setting a redirect header with a status code of 301 to any inbound traffic that requests your ads.txt file. Depending on your installation, you can do one of the following:
- Create an ads.txt file that includes the redirect logic directly, such as the following for PHP'
- Create a server-side variable either from your cache, CDN or web server that will intercept and forward all requests for your ads.txt file
- To verify it uploaded to the correct spot, you should be able to navigate to https://yourdomain.com/ads.txt and verify that the URL redirected to a.pub.network
Ensure that both secure and non-secure requests as well as the canonical and non-canonical URLs such as www and non-www are included in your redirect rules.
Questions?
Please speak with your Freestar Point of Contact, or submit an inquiry if you require further assistance.