301 Redirect

What is a 301 redirect?

A 301 redirect indicates that the web page or resource was moved from one location to another permanently.

It works by sending the 301 “Moved Permanently” HTTP status response code to the browser or web crawler along with the new destination URL.

image

The 301 redirect is the most common redirection method.

Unlike the 302 redirect (temporary redirect), the 301 redirect signals to search engines that they should update the URL of the resource in their index to a new one. For website visitors, there’s no difference between the 301 and 302 redirects.

Why are 301 redirects important?

If you move a piece of content from a certain URL and someone tries to visit it, they’ll get a “404 Page Not Found” error. A 301 redirect prevents that and forwards website visitors and search engine crawlers to the new URL. 

Besides, the 301 redirection method transfers the link equity from the old URL to the new one, meaning that the PageRank will be preserved. 

As Google’s John Mueller put it: 

“For the most part that is not a problem. We can forward PageRank through 301 and 302 redirects. Essentially what happens there is we use these redirects to pick a canonical. By picking a canonical we’re concentrating all the signals that go to those URLs to the canonical URL.”

With that said, here are examples of when to use a 301 redirect:

  • When you want content that was moved to a new location to be accessible with the old URL
  • When you want to permanently migrate a website to a new domain
  • When you want to ensure that all pages are accessible via the preferred URL standard, such as HTTPS
  • When you want to merge multiple pages or websites

How to implement 301 redirects?

There are several different ways to implement 301 redirects; your choice depends on the server and CMS your website uses. 

The most common method, however, is the one that involves editing the website’s .htaccess file, which can be found in your website’s root directory. 

If you’re looking to create a redirect for an individual page, for example, simply add the following line of code: 

Redirect 301 /old-page.html /new-page.html

One thing to keep in mind before you proceed is that there are different types of web servers, so it is possible that your website doesn’t run on an Apache server - which is the only one that uses .htaccess.

In that case, these instructions wouldn’t work for you. Instead, you can check this guide if your site runs on Windows/IIS - and this if it runs on Nginx. 

If you are using WordPress, you can simplify the process of implementing 301 redirects by using an SEO plugin: 

RankMath, for example, is free and has this feature built-in. Another option for WordPress users is the free Redirection plugin, which allows you to create and manage redirects with ease.

How to find and fix 301 redirect issues on your site

When trying to identify technical SEO issues - including problems with 301 redirects - the best approach is using website crawlers designed for that purpose. 

Ahrefs’ Site Audit and Webmaster Tools will simplify this process - and make it easier to find any 301 redirect errors. 

Here’s how you can identify any 301-redirect-related issues - and what you can do to fix them: 

Here are the most common 301-redirect-related issues - and what you can do to fix them: 

1. HTTP pages

Considering the security-related benefits and the fact that Google recognized HTTPS (Hypertext Transfer Protocol Secure) as a ranking signal in 2014, it makes sense to have an SSL certificate and migrate from HTTP to HTTPS. 

When migrating to HTTPS, it’s typically recommended to do so by using 301 redirects. However, you could face some issues, such as failing to implement the HTTP to HTTPS redirect across all pages. 

So, to ensure that your website’s visitors are actually seeing the HTTPS version of your website, use Ahrefs’ Site Audit to crawl your site and check the Internal pages report for any issues. 

2. Redirect chains

When there is more than one redirect between the original URL and the destination page, that is called a “redirect chain.” 

While Googlebot doesn’t have an issue with following this chain of redirects, it might slow things down and affect the user experience negatively. It’s not a critical issue, but it is recommended to redirect directly to the destination page. 

If that’s not possible, keep the number of redirects in your “chain” low - no more than three or at least fewer than five.

3. Broken redirects

Broken redirects are links that redirect the user (and search engine) to a dead page - or, more specifically, one that returns an HTTP 404 Not Found response status code. 

The issue with these so-called “dead” or broken links is that there is no way for Google’s bots or users to access the destination page, meaning they will likely leave the website. 

Once you’ve identified broken redirects in the Internal pages report, you can fix the errors by: 

  • Removing links that point to a redirected URL
  • Restoring the dead page (in case it has been removed by accident)

4. 301 redirects in a sitemap

The sitemap is a list of all the pages on a site that you want Google - or any other search engine - to find and index. As such, it should only include canonical and indexable pages that you want to be featured in search results. 

And since a 301 redirect is permanent and implies that the initial URL is no longer in use, there’s no point in keeping such pages in your sitemap because Google will continue to crawl them. 

To find and remove 301 redirects from your sitemap, you can either: 

  • Go to the sitemap URL (“domain.com/sitemap_index.xml” or “domain.com/sitemap.xml”), download all the URLs, and then use a free HTTP status code checker.
  • Use Ahrefs’ Site Audit to crawl your site, check for “3XX redirect in sitemap” errors in the report overview, and replace these with the redirect URL.

5. External redirecting links

If your site contains links to relevant third-party websites, it would be wise to check for any “bad” external redirecting links from time to time. 

Sometimes the resource you’re linking to gets redirected elsewhere, meaning that the URL now points to a different page - one that might be irrelevant or potentially harmful. 

Unless you have checked for issues related to external redirecting links, you will have no way of knowing that it happened - and you’ll continue linking to it unintentionally. 

You can use the Ahrefs Site Audit or Webmaster Tools to discover any links that lead to external 301 URLs and remove them manually.