A 301 Redirect is Better for SEO: But why?

You can eliminate some SEO issues by using the right HTTP redirect when carrying out big or small changes to your website’s URL structure. Where possible, do not move a website unless there is an absolute need to.

What is a HTTP 301 redirect and a HTTP 302 redirect?

A 301 redirect is a permanent redirect that tells a search engine that a page has been moved permanently to another web address. Almost all of the SEO factors (e.g credibility and link juice) that the original page possessed is passed on. The original page is also replaced in a search engine’s index with the new page.

A 302 redirect is a temporary redirect that tells a search engine that a page has moved temporarily to another URL, and the original page will be brought back online after a certain period of time. All SEO qualities a original page has is retained but not transferred over.

Why use 301 and 302 redirects?

The slightest change made to a page’s URL could potentially affect your search rankings - maybe even cause it to drop off a search engine’s index as a result. With the use of HTTP 301 and HTTP 302 redirects, you will have control over how search engines perceive your new pages when you are:

HTTP 301 redirect

  • Moving your current domain to a new domain (website migration)
  • Redirecting users to shorter SEO-friendly URLs
  • Resolving or preventing duplicate content problems

HTTP 302 redirect

  • Carrying out tests for a new page but not wanting to hurt the rankings of the original page
  • Redirecting users from the main website to a backup website while fixing the technical difficulties of the original

Why is a HTTP 301 redirect good for permanent redirection?

There is a common misconception on the use of HTTP 301 and 302 redirects. Although both HTTP response status codes serve the same purpose of redirection, the effect on your SEO can be detrimental if applied wrongly.

In most cases, webmasters want to notify search engines that a page has been moved permanently. The HTTP 301 redirect was created with this purpose in mind. Using a 302 instead of a 301 can have detrimental effects because it would prevent the passing of any SEO ranking factors from the original page to the new one - despite successfully redirecting a user.

Using a 301 redirect is better for SEO because it will automatically transfer almost all the credibility and link juice you have accumulated over time.

Do not let all the hard work you have already put in your website go to waste. Having a strong backlinks profile will greatly boost your search rankings in the SERPs and utilizing the 301 redirect ensures you will not lose most of the factors you have accumulated.

How to do a 301 redirect

For most websites, a web server’s behavior is configured through a .htaccess file - a simple text file that rests in the root folder of your website. This is where your homepage resides as well.

ftp htaccess root folder
Example of a .htaccess file in the root folder of a website

To perform a 301 redirect, you will need to:

  1. Place a .htaccess file in your root folder (if it does not exist already).
  2. Create or edit the .htaccess file using any plain-text editing tools (such as Notepad or TextEdit).


Example:

You want to do a 301 redirect from http://www.website.com/a.html to http://www.website.com/b.html.

The code in the .htaccess file would look something like this:

redirect 301 /a.html http://www.website.com/b.html


A breakdown of the code to explain:

  • redirect 301 - sets the HTTP 301 redirect status to tell search engines that the page has been moved permanently
  • /a.html - the original location of the page
  • http://www.website.com/b.html - the new location of the page for your server to redirect visitors to. (this part of the code requires the complete URL to work.)

If you have multiple pages that require redirects, you will need to create a new line of code for each of the pages.

How to do a 302 redirect

Note: The wrong usage of 302 redirects can hurt your search rankings dramatically.

Implementing a 302 redirect is similar to a 301 redirect.

To perform a 302 redirect, you will need to:

  1. Place a .htaccess file in your root folder (if it does not exist already).
  2. Create or edit the .htaccess file using any plain-text editing tools (such as Notepad or TextEdit).


Example:

You want to do a 302 redirect from http://www.website.com/a.html to http://www.website.com/b.html.

The code in the .htaccess file would look something like this:

redirect 302 /a.html http://www.website.com/b.html


A breakdown of the code to explain:

  • redirect 302 - sets the HTTP 302 redirect status to tell search engines that the page has been moved temporarily
  • /a.html - the original location of the page
  • http://www.website.com/b.html - the new location of the page for your server to redirect visitors to. (this part of the code requires the complete URL to work.)

If you have multiple pages that require redirects, you will need to create a new line of code for each of the pages.

With this new piece of knowledge in mind, begin redirecting your pages accordingly to bring the best out of your SEO and website restructuring. Each redirect was designed to suit a specific purpose - be it moving pages permanently or temporarily redirecting users to a page to resolve downtime issues.

Most of all - be sure to use a redirect only when necessary. Any form of redirection will affect your SEO.