Are you planning to move content from one page to another or from your existing domain to a new one? Here is a complete guide that will explain what a 301 redirect is.
A 301 redirect plays a crucial role in SEO. Major search engines like Google will assess the 301 status code, remove old domains from their indexes, and replace them with new ones.
In a way, it affects your SEO ranking mostly in a positive way, depending on the content, links, and technical aspects of your site.
But you are probably asking yourself: What is a 301 redirect? In this definitive guide, we will look at what is a 301 redirect and a few other important aspects of it, including why it is important and how to implement it on your site.
What Is a 301 Redirect?
In simple terms, a 301 redirect is a permanent way of redirecting one domain or URL to a new one. So, when a visitor or search engine crawler tries to access the old URL, they will be automatically taken to the new URL.
This functionality is useful in many ways, including when you are redesigning your site or consolidating multiple pages into a single page and want to transfer traffic from these pages to a new one.
Another obvious case is when you want to change your site address. We will look at these in the next section.
When a 301 Redirect Is Necessary
Besides knowing what is a redirect, it is also crucial to understand the situation where it is applicable. As noted above, 301 redirects are handy in a variety of ways.
But mostly when you want to make changes to your site’s domain, structure, or move some resources to a centralized point. Let’s discuss each of these common cases:
1. Moving or Erasing Pages
301 redirects will be useful even when you want to make changes to your domain name. For instance, you may want to get rid of some pages or content on your website.
In most cases, you might want to delete site pages or blog posts to create a new one. So, if you want to replicate the content similar to the old one, the best way to handle it is to perform a 301 redirect.
With a proper redirect, your users will not get error messages when they try to access the old pages or content.
Typically, they would receive an error 404 indicating that the content is unavailable. The same goes for search engine crawlers.
Usually, when search engine spiders scan a page and find an error, they abandon the mission. But if you use a redirect, they will move to your new page and scan the content.
2. Site Changes
One of the most popular ways 301 redirects are used is when you are making changes to your domain. For instance, you can choose to change from one domain extension, like .net to a new .com domain.
In other instances, you may be rebranding your business, which necessitates changing the business name. As a result, you may transfer your old name to a new one.
Besides the above cases, you may decide to make changes to the structure of your website. For instance, you may transfer some of the content from a subfolder to a subdomain, or vice versa.
Or you can move your www domain to a non-www one, or vice versa. In such instances, you can carry out a redirect without worrying about duplicating content.
3. Switching from HTTP to HTTPS
With the increase in cases of cybercrime, more and more websites have moved to the more secure HTTPS protocol.
Current estimates show that over 72% of websites have switched to the HTTPS protocol. So, if you are planning to switch from HTTP to HTTPS, the best way to do it is to carry out a 301 redirect, which will transfer your visitors to the more secure site.
301 Redirects vs. 302 Redirects vs. JavaScript Redirects
Part of knowing what is a 301 redirect is being able to differentiate it from other redirections. In this section, we will compare the 301 redirect with other common redirects.
The two most-used redirects are the 301 redirect and the 302 redirect. They are almost similar, but they are treated differently by the search engines.
Briefly, a 301 redirect is usually used when making a permanent move, while a 302 redirect is only useful for temporary changes to your web pages.
So, search engines will also understand these redirects that way. If a search engine bot encounters a 301 redirect, they will know that the page or content has been transferred permanently.
For that reason, it is of no meaning to continue indexing such pages. Search engines will start indexing the new pages.
The main difference between a 301 redirect and a JavaScript redirect is that the latter provides no way of accessing your site’s server.
Therefore, you should use it as your last resort. In most cases, search engines like Google prefer 301 redirects over JavaScript redirects.
The good thing about 301 redirects is that they allow you to move link juice to the new destination pages.
How to Deploy a 301 Redirect
Now that you know the basics of what is a 301 redirect, you should also know how to implement one. There are several ways to perform a 301 redirect, but the most common one is to configure code that you can add to your .htaccess file.
But note that this method is only applicable for Apache servers. The code that you will add to your htaccess file will depend on the kind of 301 redirect you want to perform.
For instance, redirecting an old domain to a new one is very different from moving a single page or even switching from HTTP to an HTTPS site.
Also, remember to back up your site before modifying your .htaccess file. This way, you can revert to your older setup in case of errors. Let’s look at each case:
1. A 301 Redirect for a Page
If you are planning to redirect a single page into a new structure, then you can add this code to your .htaccess file:
In the above case, you will need to replace the dummy addresses with the real ones.
3. Redirecting a Non-WWW Site to a WWW Domain and Vice Versa
Another common use of the 301 redirect is the transfer of a non-www site to a www one, or vice versa. You will implement these changes using two different codes, as shown below.
This is the code for redirecting from non-www to a www domain:
Remember to change the dummy address by replacing it with the real one. Also, keep in mind that the above codes will appear after the RewriteEngine On rule on your .htaccess file.
Performing Redirects Within the cPanel
Besides adding rules to your .htaccess file, you can also perform a 301 redirect within the cPanel.
As you know, cPanel is the most popular hosting management platform and allows you to perform many configurations on your site, including performing 301 redirects.
The good thing is that performing a redirect within the CPanel will automatically add a rule to your .htaccess file.
To add a 301 redirect in the CPanel, simply log into cPanel, search for the Domain section, and choose Redirects.
Once it has opened, choose the type of redirect that you wish to make. In our case, we will choose 301 permanent.
In addition to the above, choose the domain you want to redirect. If you want to redirect only a page instead of the whole domain, simply complete the path by entering it in the field with the slash (/).
After that, enter the destination URL or page. There are also options to choose to redirect with or without www. When you are done, just click on the Add button.
The only challenge with creating 301 redirects with cPanel is that it is impossible to edit them. The only way to reverse the changes is by deleting the previous redirects and creating new ones.
Using 301 Redirect Generator Tools
Even if you don’t know how to code, you can still create 301 redirection rules with the help of 301 redirect generator tools.
The good thing about using such a tool is that it takes away the guesswork and errors associated with such redirection. In any case, these tools are free to use and create functional codes.
Summary
Up to this point, we hope we have answered the question of what is a 301 redirect and how to implement one.
Basically, a 301 redirect is one of the many ways to perform a redirect on your site. Think of it like a mail forwarder.
The moment you transfer a piece of content from a specific page or URL, anyone who visits the page later will encounter an error.
This can impact the user experience and SEO performance. To improve on this, you can instruct the server to send a 301 and redirect to the new location.
The good thing about this process is that it is so fast that you will rarely notice the redirection. Another benefit is that it will help search engines find your new location when indexing your pages.
Contact
Missing something?
Feel free to request missing tools or give some feedback using our contact form.