CityHost.UA
Help and support

The main differences between 301 and 302 redirects

 12503
22.07.2019
article

 

 

Every SEO specialist, administrator, or website owner eventually faces the need to set up a redirect from one web page to another. Redirects are used in the following cases:

  • removal of pages from an online resource;
  • moving a website to a new domain;
  • removal of www from the beginning of the URL;
  • changing the URL structure (for example, example.com/2019/07/article → example.com/2019/article);
  • changing the structure of the website;
  • migrating a web resource to a different CMS;
  • merging two online projects.

Choosing the wrong type of redirect can negatively affect the promotion of a blog or online store, specifically — it can lead to a drop in the site's rankings in search engine results. You will learn about the difference between a 301 redirect and a 302 redirect, as well as when to choose the first type of redirect and when to use the second, by reading this article to the end.

Register a domain name for your website at a discount

Differences Between 301 and 302 Redirects

301 redirect is a popular and frequently used type of redirection from one web page to another. It is called permanent because it tells search engine bots that the page has been permanently removed and should no longer be indexed. A key feature of the 301 redirect is that it passes the authority (link juice) of the old (deleted) page to the new one. This allows a website to maintain its search engine rankings when deleting blog posts, news articles, or product pages in an online store.

Note! The transfer of authority from the old URL to the new one with a 301 redirect does not happen instantly. Sometimes search engines need days or even weeks, if the site is not crawled frequently, to complete the process. To speed up the authority transfer, we recommend optimizing other technical aspects of your online resource. For example, increase its speed by ordering website hosting from Cityhost.

302 redirect is a rather ambiguous type of redirection. It indicates that the requested content was found but is now located elsewhere. A 302 redirect is used when you need to redirect visitors or web crawlers to an alternative version of a page while keeping the possibility of using the original page again in the future. When applying a 302 redirect, you do not pass the authority of the old page to the new one.

Read also: What Are AMP Pages and How to Add Them to a Website

When to Use a 301 Redirect and When to Use a 302

Since a 301 redirect is a permanent redirection, use it in cases where the page has been permanently removed and there will be no other pages at the address where it was located.

Using a 302 redirect when moving a site to a new domain or changing the URL structure is not a good idea. This type of redirection is better suited, for example, for a "Deal of the Day" page in an online store. In this case, instead of changing promotional offers daily on the promoted page, it is better to set up redirects to pages like "Monday Deal", "Tuesday Deal", "Wednesday Deal", and so on.

Despite the difference between 301 and 302 redirects, their implementation on a site is the same. To set up a redirect, add the following lines to the `.htaccess` file:

  • for a 301 redirect:
Redirect 301 /old-page/ https://example.com/new-page/
  • for a 302 redirect:
Redirect 302 /main-page/ https://example.com/temporary-page/

Other situations and scenarios where it's better to use a 302 redirect instead of a 301:

  • the page being redirected from is not yet fully completed and should not be shown to visitors;
  • you need to continue indexing the old page and the links placed on it, but at the same time, visitors should only see the new page;
  • whether the new page will be indexed does not matter for the site;
  • the new page will change periodically.

Now you know the difference between a 301 and a 302 redirect and understand when it’s better to use a permanent redirection and when a temporary one.

Was this publication helpful? Then share it on social media.


Like the article? Tell your friends about it:

Author: Bohdana Haivoronska

Journalist (since 2003), IT copywriter (since 2013), content marketer at Cityhost.ua. Specializes in articles about technology, creation and promotion of sites.