301 Redirects for SEO

Are you curious about 301 redirects for SEO and how to do them properly? You’re in the right place. In theory, 301 redirects are not as complicated as some people say. Essentially all they do is redirect one webpage to another one.

The more complex part of 301 redirects is how they affect SEO. That’s why we made this guide, to show you the ins and outs of 301 redirects. Here is what we will go over.

  • What is a 301 redirect?
  • How to do a 301 redirect?
  • How does a 301 redirect affect SEO?
  • Troubleshooting 301 redirect issues
  • How 301 redirects can increase traffic

What is a 301 Redirect?

 A 301 redirect is essentially an indication that a web page has moved permanently from one location to another.

The “301” is the HTTP status code for the redirected page. A 301 redirect signals to the browser that the page has moved permanently to a new address. The browser responds by sending the user to this new location.

How Do You Do a 301 Redirect?

Although there are a few ways to do a 301 redirect, the most popular way is to just edit the .htaccess code on your site which you can find in the root folder.

If you can’t find the file there is one of two things happening:

  • There is no file yet: Just create one using notepad for windows or TextEdit for mac. Save the file as .htaccess and remove the .txt file extension before uploading.
  • You aren’t using an apache server: Apache, Nginx, and Windows/IIS are the most popular types of servers, but only Apache uses .htaccess. If you don’t know whether your site uses Apache then check here. The web server should show as Apache under hosting history.

Here are some sample codes to use for .htaccess redirects. These codes will only work for Apache servers so keep that in mind. If your site runs on Nginx then read this article, or read this article if it uses Windows/IIS.

Redirect an Old Page to a New Page

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

If you’re using wordpress then this can be super easy to do. You can use the redirection plugin to 301 redirect without needing to edit the .htaccess code.

How to Redirect an Old Domain to a New Domain

1 RewriteEngine on

2 RewriteCond %{HTTP_HOST} ^oldsite.com [NC,OR]

3 RewriteCond %{HTTP_HOST} ^www.oldsite.com [NC]

4 RewriteRule ^(.*)$ https://newsite.com/$1 [L,R=301,NC]

*Make sure to test this code before using it on your site*

We should note that if RewriteEngine on is already in your .htaccess file then don’t add it again. Simply copy the rest of the code. If you have a cpanel then just use that as it’s easier.

How to Redirect an Entire Domain from non-www to www and Vice Versa

Here is the code to go from non-www to www.

1 RewriteEngine on

2 RewriteCond %{HTTP_HOST} ^example.com [NC]

3 RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]

And here is the opposite.

1 RewriteEngine on

2 RewriteCond %{HTTP_HOST} ^www.example.com [NC]

3 RewriteRule ^(.*)$ http://example.com/$1 [L,R=301,NC]

It’s important to note that the order that the code is placed matters a lot. If you place multiple instructions in the wrong order then there may be unwanted redirect chains and other side effects.

How to Redirect an Entire Domain from HTTP to HTTPS

1 RewriteEngine On

2 RewriteCond %{HTTPS} off

3 RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

In order for this code to work you must have an SSL certificate installed on your site. If not you’ll get the “not secure” message in the browser.

Redirect an Entire Domain From non-www to www and HTTP to HTTPS

1 RewriteEngine On

2 RewriteCond %{HTTP_HOST} !^www. [NC]

3 RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

4 RewriteCond %{HTTP:X-Forwarded-Proto} !https

5 RewriteCond %{HTTPS} off

6 RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Do 301 Redirects Affect SEO?

It’s well known in the SEO world that 301 redirects can have an effect on pagerank. 

If you don’t know what pagerank is, it’s the formula that Google make which rates the value of a page. This rating is based on the quality and number of links going to it. There are of course many other ranking factors than pagerank, but pagerank is highly correlated with higher rankings.

Here is some evidence from Google themselves that confirms this:

Gary Illyes:

“DYK that after 18 years we’re still using PageRank (and 100s of other signals) in ranking?”

If you want to read more about Pagerank then click here and view this picture.

Also ahrefs has a formula called URL rating which has a similar function to pagerank and is highly correlated with the amount of traffic that a page gets.

UR is definitely not equivalent to pagerank in any way, but since Google discontinued public pagerank in 2016 this is the closest thing we have now. 

So now you’re probably wondering how this matters for 301 redirects? 

Well, when public pagerank was available, using a 301 redirect used to result in a loss in pagerank. The amount of loss is highly debated but generally accepted to be around 15%. The former head of webspam (Matt Cutts) also hinted at this number in a video.

Although Matt doesn’t say the number is exactly 15% that is the number that SEOs used for quite some time. This is because the 15% is based on the “dampening factor” in the patent for pagerank.

Let’s use an example now and go with the 15% number. This is what it would look like.

Simple 301 redirect: domain.com/page‑1 → domain.com/page‑2 = 15% loss of PageRank

301 redirect chain: domain.com/page‑1 → domain.com/page‑2 → domain.com/page‑3 → domain.com/page‑4 = 38% loss of PageRank!

Google did change their stance on this in 2016 though. Gary Illyes stated that: “30x redirects don’t lose pagerank anymore.”

So in layman’s terms, if you do a 301 redirect in 2019 then the redirected page should keep all the power that the original page had.

This is very important and also why 301 redirects can be used for increasing search traffic.

It’s not all sunshine and roses though, 301s can cause lots of SEO issues that aren’t commonly  discussed.

How to Fix Existing 301 Redirects on Your Site

Here is how you can troubleshoot 301 redirect problems on your site.

#1 Make Sure HTTP Redirects to HTTPS

In 2019 every website should be using HTTPS. Google uses it as a ranking factor and it adds security for your sites visitors. Services like Let’s Encrypt leave little excuse not to implement it on your site.

Simply having an SSL certificate is only step one though…

You also have to make sure that the correct 301 redirect is in place. You can check if it is by visiting the homepage on your site and looking at the URL bar. There should be https://www.domain.com/ with a lock icon to the left.

To test it, remove the “s” and then hit enter. It should automatically redirect to the HTTPS version. As long as this happens then most things should be working properly. However there are some other issues that can arise:

  • HTTP to HTTPS isn’t active on all pages on the site (ex.subdomain)
  • Active HTTPS to HTTP redirects

To make sure that these issues don’t exist use the ahrefs site audit. Go to internal pages report and look for the following issues:

HTTP to HTTPS redirect

HTTPS to HTTP redirect

If you see a page with an HTTP to HTTPS warning and it is the version of the page where the crawl started then don’t worry, it’s not a problem.

From there you simply fix the highlighted issues by doing a proper 301 redirect from HTTP to HTTPS version for the affected pages.

#2 Make Sure Pages With 301 Status Codes From the Sitemap

Google uses your sitemap to find which pages to crawl and add to the index. A page that has a 301 status code technically no longer exists so there is no point having it in your sitemap. Having Google revisit the page over and over is a waste of crawl budget so try to avoid this.

Here is how you can find these pages:

  • Find the sitemap: it will usually be at domain.com/sitemap.xml
  • Use LinkKlipper to download all the URLs 
  • Paste those URLs into a free status code checker like this one 
  • Filter for 301 status codes

If you want an easier way to do this then use the ahrefs site audit to crawl the site and then go to overview and look for “3XX redirect in sitemap” issues. This will show all the pages that have 301 status codes. Remove these from the sitemap and replace with the final redirect URL.

#3 Fix Redirect Chains

A redirect chain is when there is a series of two or more redirects between the first URL and the final URL.

Here is Google’s statement on these:

“While Googlebot and browsers can follow a “chain” of multiple redirects (e.g., Page 1 > Page 2 > Page 3), we advise redirecting to the final destination. If this is not possible, keep the number of redirects in the chain low, ideally no more than 3 and fewer than 5.”

Redirect changes have no upside. All they do is hurt the user experience and make things slower. Avoid them at all costs.

You can look for 301 redirect chains with this tool. You are looking for pages that have two or more redirects.

If you need to check more than 100 pages at once then use ahrefs site audit and look at the “redirect chain” errors. This will show you all URLs in the redirect chain.

Here are two ways that you can fix this:

  1. Swap out the redirect chain with a single 301 redirect. So instead of Page 1 > Page 2 > Page 3, change it to Page 1 > Page 3.
  2. Change the internal links to redirected pages with direct links to the destination URL. This will stop Google from crawling through the redirect chains. Also it stops actual site visitors from having to wait for multiple redirects when browsing your site.

The second solution is the best method. You can do this by sorting the number of redirect chains by high to low then clicking on the number of internal links to reveal all the redirected page’s links. Then just replace all the links with direct links to the target URL.

#4 Fix Redirect Loops

A redirect loop is a frustrating scenario for both search engines and users. It usually goes something like this.

Ex. Page A > Page B > Page C, Page B, Page C, Page B

As you can see this is a major user experience killer and can result in the users browser displaying an error from all the redirects.

This error can be fixed by using the HTTP status code checker from before. Find the “Exceeded maximum number of redirects” errors.

If you need to check more than 100 pages then use the internal pages report in ahrefs site audit and find the “redirect loop” errors.

You can then fix the error by doing the following:

  • If it’s not supposed to be a redirect then change the response code to 200.
  • If it is supposed to redirect then change the final URL to remove the loop. You can also remove or replace all internal links to the redirected URL.

#5 Fix Broken Redirects

A broken redirect is a redirect that goes to a broken page (ex. 4XX or 5XX code).

These are not good for a couple reasons. One is that your visitors won’t be able to get the final URL. Also it can cause the search engine to abandon the crawl. You can find these errors by using an HTTP status code checker.

To find more pages you can use the “broken redirect” error in the internal pages report in ahrefs site audit.

Do this to fix these problems”

  • Restore the broken page if it was removed accidentally
  • Remove the link to the redirected URL

#6 Redirect 404 Pages

Any page that returns a 404 is a broken page and the browser shows a message on screen like “404 not found”. 

These 404 pages are a problem in these scenarios:

  • They have backlinks: a 404 page isn’t accessible so any links that point to them are a waste of juice.
  • They can be crawled: If a page is crawlable there’s a good chance it’s clickable. If it is clickable then there is a good chance that a user will get to the broken page. This will hurt user experience for sure. 

To fix this go to “internal links” report in ahrefs site audit and look for the “404 page” errors. You can find all the pages that were found during the crawl in this report.

The next step is to use the “manage columns” button and add the “no of dofollow backlinks” column. Then hit apply and sort it from highest to lowest.

Look at the backlinks report in site explorer to find pages that have any “dofollow” backlinks. If there are any they might be high quality and you can 301 redirect them to a relevant page to save the link juice that goes to them.

NOTE: It’s important to redirect the pages to another relevant page. Google has stated that irrelevant 301s are treated as soft 404s. What this means is that there is no advantage to redirecting irrelevant pages. Watch this video for more information.

If you don’t have a good page on the site to redirect then you can republish the content that used to exist there. The reason for this is that if the content was high quality and people like it then why was it removed?

If a page doesn’t have any good dofollow backlinks then you can do the following:

  • Bring back the broken page at its original URL
  • Redirect the broken page to another relevant page
  • Replace or remove all the internal links to the broken page

If you go for the last option then make sure that you change the anchor text and surrounding text around the link to make sense when it’s necessary.

#7 Replace 302 Redirects and Meta Refresh Redirects with 301s

You don’t ever want to use a meta refresh redirect or a 302 redirect for anything permanent.

302 redirects are temporary. Also Google themselves say not to use meta refresh redirects at all. If you use either of these then you should try to replace them with a 301.

In order to find the HTTP status codes check the internal pages report in the site audit tool. Look for “meta refresh redirect” and “302 redirect” problems.

You can fix both of these issues by doing this:

  • If the redirect isn’t permanent remove it
  • If the redirect is permanent then change it to a 301

Also try to replace or remove any internal links to the redirected pages, as they can confuse users when clicked on.

#8 Look for Redirected (301) Pages That Get Organic Traffic

Any page that has an HTTP 301 code shouldn’t be getting organic traffic because it won’t be in Google’s index if the redirect has been found.

You can see if there are any 3XX pages with traffic by looking at the overview report in ahrefs site audit. Look for the error “3XX page receives organic traffic.

If you already have a list of 3XX pages from another resource then input them into the bulk analysis tool in ahrefs and look at the page level organic traffic.

We should note that if the redirect is recent then Google just might not have seen it yet. They should see it during their next crawl where they will remove the page from the index. Make sure to also remove the pages from your sitemap and then reupload it to Search Console.

#9 Look for Inappropriate 301s

It’s perfectly normal for a site to link to a third party site. It gets bad, however, when the page that is linked to gets redirected somewhere else that might not be appropriate.

Here is an example scenario: if you happened to link to a relevant resource, then notice that a year later the domain expired and got redirected to an affiliate marketing website. In this scenario you’re linking to something that could be considered bad for your visitors.

 It’s good to check for these irrelevant redirects every so often. You can do this by going to “external pages” report in ahrefs and look for “‘external 3XX redirect” warnings under issues.

If you’re getting a lot of pages it could be because nofollowed external links like blog comments are clogging up the report. You can remove these by adding “No. of inlinks dofollow > 0 to the report.

Then look at the URL and redirect URL columns for any redirects that look out of place. Anything that goes to another page or site is what you’re looking for. When you find these redirects the best thing to do is remove them.

How to Boost Rankings with 301 Redirects

If you’ve followed along this far you will have fixed any issues relating to 301s in SEO. Now we will go over how you can actually boost your organic traffic with 301s. There are two ways that  you can accomplish this.

Combination Technique

You might have two different articles on your site that are doing ok by themselves, but what if they were combined?

If they are indeed topically relevant, then combining them could make two average pages into one elite page. This can work really well. Here is why it works:

  • Superior content: if both posts have “ok” content but maybe are outdated then combining them might create a much better piece of content that can rank higher.
  • Merging authority: we mentioned earlier that 301s don’t lose any pagerank anymore. Therefore, combining the articles together will transfer all of the authority to the new article. This only works if they are relevant, as Google considers non relevant redirects to be soft 404s.

By this point you’re probably wondering how to replicate this on your own site. Here’s how to do it.

Step1: Find Cannibalized Pages with Links

If you didn’t know, keyword cannibalization is where two pages target the same keywords. This sometimes results in Google ranking neither page for the keywords in question. 

Finding these pages is easy. First go to ahrefs site explorer and export the keywords for the site. Then setup the sheet so there are 5 columns: Keyword check, keyword, position, search volume, url. Use this formula in the Keyword check column =IF(B2=B3,”Cannibalized”,IF(B1=B2,”Cannibalized”,”Unique”)). 

This formula will show you all the cannibalized keywords by saying “cannibalized” next to them.  Then you can sort the sheet and get all the cannibalized keywords in order.

Step 2: Find Opportunities

The next step is to look at the results and find pages that are topically related for a potential redirect. This requires some manual work to consider what pages would work well combined.

Step 3: Merge the Pages

Now you want to merge the pages by taking the best parts of each and combining them into one.

Since you don’t want Google to treat the 301 as a soft 404 it’s important to make sure that the relevance is high. One way to make sure of this is to check the anchors report in site explorer for both pages.

This can give you some insight into why people are linking to each page. If they are using certain words or quotes in their anchors then you will want to make sure that you keep these in the new article.

When you do the rewrite make sure to give the searchers exactly what they are looking for. Take a look at the top 10 results and make sure to replicate what is already ranking. This will ensure that you maximize the ROI for your efforts.

Step 4: Publish the New Page and Initiate the 301

It’s finally time to publish the new page. If either of the old URLs are a good match for the topic of the new page then just use that one and delete the other.

On the other hand, if neither URL is appropriate then it’s perfectly fine to just redirect both pages to a new URL.

Merger Method

This method can bring explosive increases in organic traffic as shown by Brian Dean. He acquired an SEO blog called Point Blank SEO and redirected it to his blog Backlinko. This doesn’t mean that you should go out and buy up every relevant blog and redirect them all. If you want to do this properly there are some things to do.

First is that you need to do the 301’s on a page by page basis. The days of redirecting every page to your homepage are over and it takes more effort nowadays. Here’s how it’s done.

Step 1: Redirect Content

This is where you will get the biggest gains in organic traffic. If you look at the Backlinko example you can see that Brian Dean did this with some of the biggest posts on the Point Blank SEO blog. The “link building strategies” post for example, now has all links pointing to backlinko.com/link-building-strategies because of the 301. Redirecting the content to a new home is your best bet if:

  • The content has good organic traffic
  • The content is high quality
  • The topic is relevant to your site

We should note that the content doesn’t necessarily have to be super high quality to do the redirect. You can always just rewrite it if necessary. This is what Brian did, as the old content hadn’t been updated for years.

Step 2: Delete and Redirect to a New Page

If there are pages on the site that have no potential for organic traffic or are duplicates of topics you’ve covered then there is no point in keeping them. 

For example, there’s no point in redirecting the contact page to the new website because not only does it not rank for anything, but you also don’t need two contact pages.

Also, if a page doesn’t have much potential to get traffic then it’s best to redirect it elsewhere or get rid of it. This is what Brian did with a post on the pointblankseo.com site. He redirected the “Link Building Outreach Platforms Compared” post to his “Link Building Tools” post.

This was a smart move by him because the keywords for the old post had very little volume, whereas his post had much greater search volume.

Step 3: Redirect to the Homepage

If there isn’t anywhere relevant to redirect the page then the best option is to redirect to the homepage. You can see that Brian did this with lots of pages on pointblankseo.com. 

We mentioned earlier that Google treats irrelevant 301s as soft 404s but this doesn’t necessarily happen 100% of the time. So it makes sense to just redirect them and hope that Google transfers the link juice.

One important note is that you shouldn’t redirect pages with low quality links. Doing this could harm your site. Look in site explorer first and see if there are any spammy links. If so just delete the page and leave it as a 404. 

In Conclusion

It’s no secret that 301 redirects can be a powerful tool in an SEO specialists arsenal if used properly. You must first make sure that there aren’t any existing issues with your site however, or you could sabotage the future of your site.

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

More To Explore

Scroll to Top