This section expands our ads.txt setup article to cover steps on setting up a 301 redirect for Apache web servers.

  • Look for the .htaccess file in the root directory of your site. If it doesn’t exist, create one.

  • Add the following lines if they are not already present in the file

Options +FollowSymLinks
RewriteEngine on
  • Add the following line in the file, replace #### with the ID of your property, found in your site list in the NitroPay panel.

Redirect 301 /ads.txt https://api.nitropay.com/v1/ads-####.txt
  • Save the file (and deploy your website if necessary).

  • Test that the redirect works by going to yourdomain.com/ads.txt and noting that the URL and contents changed to the hosted ads.txt.

Did this answer your question?