Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you set ads.txt to redirect to a file on another server?

Tags:

redirect

ads

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?

like image 766
user2459203 Avatar asked Nov 22 '17 17:11

user2459203


2 Answers

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]
like image 50
user2459203 Avatar answered Sep 28 '22 18:09

user2459203


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.

like image 25
Ektoras Karagiannis Avatar answered Sep 28 '22 18:09

Ektoras Karagiannis