URL Redirect 301 is a permanent type of unmasked redirect.
It should be used if your website was permanently moved to the new address and you want it to be indexed by search engines (all traffic and existing SEO value will be routed to the destination URL).
301 redirect DNS record method is ideal if you want to redirect one website traffic to another permanently in the same server.
They are permanent redirects that can be done through DNS records. Moreover, this type of redirect is highly recommended for SEO ranking.
In this context, we shall look into steps to create the 301 redirects and fix their issues.
How to create a 301 redirect DNS record?
Now, let's see how we can create a 301 redirect by adding the DNS records.
We add the below DNS record to create a redirect from example1.com to example2.com:
example1.com. IN A x.x.x.x
www.example1.com IN CNAME example2.com
Common errors related to 301 redirect DNS record
Now let's see some of the common errors that are related to 301 redirects.
1. Incorrect DNS
For any website to load successfully, it should have correct DNS records. Sometimes, few customers do make some mistakes in updating the right DNS records.
Entering a wrong DNS record will lead to failure in loading a website in the browser.
So our Support Experts initially check for the right DNS records and then update them accordingly.
Updating the correct record will fix the website redirect issue.
Recently, one of our customers approached us telling us that the website redirect isn’t working well. When checked, we found that the A record of the domain was pointing to an IP whereas the CNAME record for www was pointing to another website.
This redirect actually doesn't work. Below is an example of how the record looked:
example.com. IN A x.x.x.x
www IN CNAME example2.com.
We updated the record with the right ones and they are as below:
example.com. IN A x.x.x.x
www.example.com IN CNAME example2.com.
This ensures that when the example.com website is called, it will be redirected to example2.com.
2. Implementing two redirect methods Omission of anyone redirect method
We can create 301 redirects either via DNS records or via the .htaccess file.
However, we can follow only one method to create the redirect.
In case if both the methods are implemented then the website will throw an error "Too many Redirects".
If the customer is using two methods to create the redirect then we must remove one among them.
We can simply delete the .htaccess file which contains the redirect rule or else we can only remove the redirect rule present in the .htaccess file.
By doing this, the redirect will initiate only from the DNS records and no redirect methods fluctuate.