We’ve recently provided a lot of information about ads.txt. From the fundamentals to a straightforward explanation of how ads.txt affects your revenue. Hopefully, we’ve made it clear how critical it is to maintain that file up-to-date and tidy.
Here are other resources designed to help publishers maintain their files even if they don’t use the Monumetric Plug-in.
Enable 301 redirect
You can enable a 301 URL redirect from the “/ads.txt” path of your site. With the Monumetric-hosted ads.txt, we only have to worry about clearing the cache while the redirect is initially set up.
Once it’s installed, all updates are reflected immediately due to the fact that we always display the latest version on our server. You can leave the updating to us!
Whether you are using one of the most popular web servers like Apache, Nginx, or anything else like cPanel, we have some basic instructions and tips below.
Set up the redirect for Apache:
Each server is set up a little differently, but these basic instructions should work for the majority of cases.
Remember, if you are having a difficult time setting up the redirect you can contact your host for help or allow Monumetric temporary FTP access to make the changes for you.
The first step requires opening and modifying the .htaccess server file.
- The file can be accessed using FTP or through the cpanel.
- The file is generally located within the root directory of the website.
- If you can’t see the .htaccess file, programs like FileZilla have the option to force the server to show all files.
4. Create a backup of this file BEFORE modifying it.
Once you have the .htaccess file backed up and open you need to add this snippet to the bottom of the file.
- IMPORTANT: On line 4 you need to replace [monumetric hosted adstxt url] with the Monumetric hosted ads.txt URL for your site. You can get the ads.txt URL from your Console in the Messages > Ads.txt message and Ad Code download message.
- Save and close the file
- Here is what .htaccess fileshould look like:
Add any 3rd party (non-monumetric) ads.txt lines through the Monumetric Ads Console
- You can access that through Console’s Settings → Ads.txt Settings Tab
- You can access that through Console’s Settings → Ads.txt Settings Tab
Verify the redirect works by going to your ads.txt URL and confirm that you are redirected to the URL entered into the .htaccess file.
Set up the redirect for Nginx:
IMPORTANT: This will require editing the nginx.conf file and does come with risks.
Any mistakes can cause serious problems with your server. Make a backup of the file BEFORE you edit it.
This file is usually located in the etc/nginx/ directory (etc/nginx/nginx.conf). The entry will be placed in the server block. Within the nginx.conf file under the server block includes an entry that looks like this:
This this blog explains in general terms how to set up the redirect.
Thank you for working with us on this important task. If you need any help you can always reach your Publisher Success Team at success@monumetric.com.
We’re here to help.
Additional Resources
Helpful video and article for cPanel:
FAQs:
How do I redirect a URL with parameters?
To redirect your domain to a particular page,folder or subfolder of the destination domain, add a forward slash (“/”) to the end of the destination URL.
Once you add this symbol after http://webpage.com -> http://webpage.com/ , the URL domain .com/abc123, will redirect the users to http://webpage.com/abc123 or http://webpage.com/ads.txt respectively (in case the sub-folder (“/ads.txt” or “/home”) exists on webpage.com).
What does create a URL Redirect mean?
URL Redirect (also known as URL Forwarding) is an approach for redirecting your domain’s visitors to another URL. You can point your domain name to any website, webpage, or online resource. HTTP protocol status codes are used for redirects.
Can you put a redirect in a URL?
Redirects allow you to route users to another website page from a specified URL. You can add redirects in Site Tools by navigating to Domain > Redirects. Choose the desired domain, enter the URL to be redirected, then enter the URL of the new page destination.
What is a redirect URL example?
When a web page is accessed at a specific URL, it is redirected to an other URL. For example, if a user hits “website.com/page-a” in their browser, they are routed to “website.com/page-b” instead.
What is the best URL Redirect?
301 Redirect URL: It is the most commonly used and clean redirect code. A 301 redirect code is utilized to keep traffic, rankings, and backlinks. A 301 redirect is the most efficient and search engine-friendly way for a redirect because it finally gets indexed by search engines that incorporate its new content.
Is URL forwarding the same as a redirect?
A Forward and a Redirect are not the same thing to a web application developer. A Forward modifies URLs on the server without informing the browser, but a Redirect instructs the browser to retrieve the new URL.