What is 301 Redirect?
A 301 redirect is an HTTP status code that web servers send to browsers and search engines to notify them that a specific webpage has permanently moved from one URL to another.
This redirect not only sends visitors to the new URL but also passes the SEO value from the old URL to the new one.
It is just like moving to a new house and updating your address with the post office. It helps people find your new address when they try to go to your old one. It's a way to make sure people get to the right place without any difficulty.
When should you use a 301 redirect?
There are several situations where it is recommended:
Rebranding or Renaming
When a company switches to rebranding and needs to send its visitors or search engines to the new website - it uses a 301 redirect.
Suppose your old website was "oldbrand.com" and the new one is "newbrand.com" - you'll implement a 301 redirect from the old site to the new site.
URL Structure Change
Let's suppose you decide to change your website's URL structure for better organization or SEO, you'll also need a 301 redirect.
For instance, if you have a blog post with the URL "website.com/blogpost" and you want to change your URL structure to include the date. Now it may look like this "website.com/2023/07/blogpost" after implementing 301.
Merging Websites or Pages
301 redirects can also be used to integrate two sites or resources on the same topic. As a result, visitors to the old page will be immediately redirected to the new consolidated page.
You can get an idea from this example. If you have two pages "website.com/smartphones" and "website.com/mobiles" and you decide to combine them into "website.com/mobile-devices" you will use a 301 redirect on both pages. As a result, everyone will be directed towards the new page which is "website.com/mobile-devices".
Deleting Pages
If you decide to delete pages because they are no longer relevant or are old, implement a 301 redirect to a relevant page instead of redirecting readers to a 404 error page.
Like if you've previously had a webpage about a specific event that's now over like "website.com/2023-event" you should redirect users to a page that hosts future events or relevant activities.
Protocol Change
Sometimes website owners change their URL from HTTP to HTTPS. In that case, 301 will be implemented because HTTP and HTTPS URLs are technically different and without a redirect, you may end up with duplicate content issues.
For easy implementation of HTTP to HTTPS or HTTPS to HTTP URL redirects - utilize our HTTP vs HTTPS Redirects tool.
Consolidating Subdomains
If you initially hosted your blog on a subdomain like "blog.yourwebsite.com" and decide to move it to a directory on your main site like "yourwebsite.com/blog" you'll need to use a 301 redirect to guide visitors to the new location.
Canonicalization Issues
Sometimes a website can be accessed both with and without www. If you have a similar issue, you can pick a preferred version and use a 301 redirect.
It's essential to ensure that the new page is as relevant as possible to the old one when implementing a redirect. This will help maintain the user experience and the SEO value of the original page.
How to do a 301 redirect?
Implementing 301 redirects depends upon the platform you use or the server your website is hosted on:
For WordPress Websites
Setting up a 301 redirect in WordPress is a breeze, especially if you use plugins like Yoast SEO Premium. The redirects manager tool is already included in Yoast SEO Premium.
You can also install a dedicated plugin like Redirection or Rank Math. These plugins provide an easy-to-use interface where you can input the old URL and the new URL for the redirect.
Here is how you can use them:
Yoast SEO Premium: In your WordPress dashboard, navigate to the Yoast SEO Premium plugin settings. You will find an option for 'Redirects.' Here you can add the old URL in the 'Source URL' field and the new URL in the 'Target URL' field. Click 'Add Redirect' and the 301 redirect will be set up.
Redirection Plugin: After installing the Redirection plugin, go to 'Tools' and then 'Redirection.' You'll find fields for 'Source URL' and 'Target URL.' After entering the appropriate URLs, ensure that the 'Group' is set to 'Redirections,' and the 'Match' is set to 'URL only.' Then click 'Add Redirect.'
Shopify Stores
For Shopify users, the process is straightforward. You'll navigate to the "Navigation" section under "Online Store" in your sales channels.
There you'll see an option called "View URL redirects." Upon clicking, you'll find an option to "Create URL redirect." Simply add the URLs you want to redirect from and to and save the changes.
Magento Stores
Magento has inbuilt functionality for 301 redirects. The process differs slightly between Magento 1 and Magento 2.
Magento 1:
Navigate to 'Catalog' and then 'URL Rewrite Management.'
Click on 'Add URL Rewrite.'
Select 'Custom' from the 'Create URL Rewrite' dropdown.
Fill in the 'ID Path,' 'Request Path' (old URL) and 'Target Path' (new URL), select 'Permanent (301)' in the 'Redirect' dropdown and write a description. Click 'Save.'
Magento 2:
Navigate to 'Marketing,' then 'SEO & Search,' and then 'URL Rewrites.'
Click on 'Add URL Rewrite.'
Select 'Custom' in the 'Create URL Rewrite' dropdown.
Fill in the 'Store,' 'Request Path' (old URL), 'Target Path' (new URL), select 'Permanent (301)' in the 'Redirect Type' dropdown and write a description. Click 'Save.'
Apache Servers
If your site is hosted on an Apache server, you have to make changes in the .htaccess file. This approach requires caution and expertise because errors can negatively impact your website.
You'll need to write specific rules under the "RewriteEngine On" section which will tell the server how to handle the redirect. These rules will differ based on your specific needs such as redirecting a single page, the entire site or from HTTP to HTTPS.
If you are finding it difficult to generate the correct .htaccess code manually, feel free to use our handy .htaccess code generator tool for quick and accurate results.
Nginx Servers
Similar to Apache, setting up a 301 redirect on Nginx requires editing the .conf file on your server. Depending on your needs you'll write certain lines of code that specify how to redirect URLs.
Remember, this method should only be performed by experts due to the potential risks involved.
Access your server root and find the .conf file.
Open the .conf file in a text editor.
Add your redirect rules inside a 'server' block. For example, to redirect a single page, add 'rewrite ^/old-page$ http://www.website.com/new-page permanent;'.
Save the .conf file and restart the Nginx server to apply the changes.
Remember that implementing 301 redirects should be done carefully because any mistakes can cause serious problems with your website's functionality and SEO performance.
Before making any changes, always back up your original files and seek professional assistance if you are unsure.
301 redirect and SEO
Before 2016, implementing a 301 redirect would lead to some loss in PageRank as confirmed by Matt Cutts.
This loss would increase with each redirect in a chain. However, Google revised its policy in 2016 and a 301 redirect no longer results in PageRank loss.
This makes 301 redirects a powerful tool for preserving and improving organic traffic.
How to boost SEO using 301 redirects?
A 301 redirect can be used strategically to boost SEO performance and prevent traffic loss.
Below are some ways on how you can use it for SEO purposes
Merging Duplicate Content
Consolidating similar or duplicate content into a single authoritative page can boost your SEO.
By doing so you can consolidate your inbound links and page authority which would otherwise be dispersed thinly across multiple pages onto a single page.
You can facilitate this process by employing a 301 redirect to guide both visitors and search engines from the previous duplicate pages to the consolidated and updated page.
To do this you can use our tool 301 Redirect File or Directory.
Simply input the URL that you wish to redirect to the primary or canonical version as well as the URL of the canonical page itself. This process will generate the necessary code which can then be inserted into your .htaccess file.
Site Rebranding or Moving
When you move to a new domain or rebrand, use 301 redirects to maintain SEO equity by redirecting traffic from your old domain to your new domain.
This not only ensures that users find your new site but also signals to search engines that your site has moved.
Cleaning Up Dynamic URLs
Dynamic URLs which often include long strings of parameters and numbers can be off-putting to users and challenging for search engines to crawl.
When you create clean static URLs and redirect dynamic URLs to them, you make your site more user-friendly and easier for search engines to index.
Website Restructuring
When you change the structure of your website, whether it's changing the URL paths of your pages or switching from a subdomain to a subdirectory - you must ensure that your visitors and search engines are seamlessly directed to the new locations.
Let's say you have a subdomain like "https://blog.mywebsite.com" and you're planning to shift it to a subdirectory such as "https://mywebsite.com/blogs".
In this case, utilizing a 301 redirect again becomes crucial. By employing our 'Subdomain to Subdirectory Redirect' tool, you can streamline this transition.
Simply input the URL to which you want your subdomain to redirect and the tool will handle the rest by generating a code.
Now you can paste this code into your .htaccess to redirect a subdomain to a subdirectory.
Correcting 404 Errors
When a page is deleted or its URL is changed without a corresponding redirect, 404 errors can occur.
These errors can degrade the user experience and have an impact on your SEO if important pages go down unexpectedly.
To maintain your SEO value, you can also set up 301 redirects from deleted or moved pages to relevant existing pages.
Consolidating WWW and Non-WWW Domains
Search engines treat www.example.com and example.com as two separate websites. If you don't specify a preferred domain, your inbound links might get split between the two versions.
You can choose a preferred domain and use a 301 redirect to send traffic from the non-preferred version to the preferred one to consolidate your link equity.
If you aim to redirect a 'www' URL to its 'non-www' counterpart, you can use our tool designed to ease this process.
Conversely, if your goal is to redirect a 'non-www' URL to its 'www' version, you can utilize our 'Non-WWW to WWW Redirect' tool.
This will generate the necessary code which you can conveniently paste into your .htaccess file.
Common 301 redirect mistakes
Despite the power of 301 redirects, they can sometimes be misused which may lead to problems for both users and search engines.
Below are some common 301 redirect mistakes and tips on how to avoid them.
Redirect Chains
This is when a URL is redirected to another URL which in turn is redirected to yet another URL, creating a chain of redirects. This can cause the site to load slowly and provide a poor user experience.
Search engines may also stop following the redirects after a certain point which can lead to lost link equity.
Solution: It's essential to conduct regular audits of your website's redirect rules. This ensures their necessity and helps eliminate any potential chains or loops.
Redirecting to Irrelevant Pages
Redirecting a page to another page that is not relevant or does not contain similar content can confuse visitors and lead to a high bounce rate. Search engines might also see this as a deceptive practice.
Solution: Always redirect to a page that offers similar or related content. If a similar page does not exist, it might be better to return a 404 or 410 status code.
Not Redirecting All Versions of Your Site
If all versions of your site (HTTP, HTTPS, www, non-www) are not properly redirected to your preferred version, it can lead to duplicate content issues.
Solution: Be sure to set up proper redirects so that all versions of your site point to your preferred domain.
Neglecting to Update Internal Links
While 301 redirects can handle traffic to old URLs, it’s not a good practice to rely on them to handle internal linking on your site. This extra redirect can slow down your site and negatively impact user experience.
Solution: Whenever you change a URL that is linked internally on your site, make sure to update the internal links to point to the new URL.
Forgetting to Implement Redirects
When URLs change, especially during a site redesign or migration, it's common to forget to put in place 301 redirects from the old URLs to the new ones. This can lead to a loss of traffic and a drop in search engine rankings.
Solution: Plan your redirects carefully during a site redesign or migration and implement them as soon as the new URLs go live.
Takeaway
301 redirects are crucial in website management and search engine optimization.
They help reroute users and search engines from an old URL to a new one. It aids in website restructuring, consolidation of duplicate content and site migration or rebranding.
301 redirects must be used carefully as incorrect implementation can lead to issues such as redirect chains, loops or lost traffic. Regular audits can help prevent these problems and ensure optimal website performance.