I've hit a bit of a problem with creating an ads.txt file. I'm working with an advertiser, and they would like to host the ads.txt file so they can easily make changes to it.
Is it possible to set up a redirect in at
mysite.com/ads.txt
which points to something like
theirsite.com/mysite/ads.txt
If so, what would be the code to you in mysite.com/ads.txt
to make the redirect work?
For those looking, I did eventually find a solution to this by editing the following line into the .htaccess (you'll need to alter the path for your own link):
RewriteRule ^ads\.txt$ "https\:\/\/theirsite\.com\/clients\/folder\/ads\.txt" [R=301,L]
Per IAB's ads.txt Specification 1.0.1 (September 2017), section 3.1 "ACCESS METHOD",
Only a single HTTP redirect to a destination outside the original root domain is allowed to facilitate one-hop delegation of authority to a third party's web server domain.
So you should be fine with a single redirection from mysite.com/ads.txt >> theirsite.com/mysite/ads.txt.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With