Every seoshnik, administrator or site owner at some point faces the need to set a redirect from one web page to another. Redirects are used in the following cases:
- deletion of online resource pages;
- transferring the site to a new domain;
- refusal to use www at the beginning of the URL;
- changing the structure of the URL (for example, example.com/2019/07/stattya > example.com/2019/stattya);
- the structure of the site has been changed;
- CMS change;
- merging of two sites.
An incorrectly chosen type of redirect can negatively affect the promotion of a blog or online store, and the site's position in search results can "fall". Read this article to the end to learn how a 301 redirect differs from a 302, as well as when to choose the first type of redirect and when to choose the second.
Differences between 301 and 302 redirects
A 301 redirect is a popular and frequently used type of redirect from one web page to another. It's called permanent because it tells search engines that the page has been removed permanently and should no longer be indexed. The peculiarity of the 301 redirect is that it transfers the weight of the old (deleted) page to the new one. This allows you to save the position of the site in search engine results in case of deletion of articles in the blog, news in the portal or product cards in the online store.
Pay attention! The transfer of weight from the old URL to the new URL during a 301 redirect is not immediate. Sometimes it takes search engines days or even weeks if the site is crawled infrequently by web crawlers. In order for weight transfer to occur faster, we recommend optimizing other technical parameters of the online resource. For example, increase its speed by ordering CityHost website hosting .
A 302 redirect is a rather ambiguous type of redirect. It indicates that the requested content has been found, but is now located elsewhere. A 302 redirect is used in cases where it is necessary to redirect visitors or web crawlers to an alternative version of the page and at the same time preserve the ability to use the page from which the redirection was made in the future. By applying a 302 redirect, you do not transfer the weight of the old page to the new one.
In which cases to use 301 redirect, and in which to use 302
Because a 301 redirect is a permanent redirect, use it in cases where a page has been permanently deleted and there are no more pages at the address it was on.
Applying a 302 redirect when moving your site to a new domain or changing your URL structure is not a good idea. This redirection is the right one to use, for example, for the page "Offer of the day" in the online store. In this case, instead of changing the promotional offers on the page you are promoting every day, it is more correct to redirect to the pages "Monday's promotion", "Tuesday's promotion", "Wednesday's promotion", etc.
Pay attention! Although there is a difference between 301 and 302 redirects, their implementation on the site is the same. To redirect, add the following lines to .htaccess:
- Redirect 301 /stara-storinka/ https://example.com/nova-storinka/ — for 301 redirect;
- Redirect 302 /osnovna-storinka/ https://example.com/tymchasova-storinka/ — for 302 redirect.
Other situations and scenarios when it is better to use a 302 redirect instead of a 301:
- the page from which the redirection is performed is not yet finished and does not need to be shown to visitors yet;
- you need to continue indexing the old page and the links placed on it, but,
- at the same time, it is necessary that visitors see only the new page;
- whether the new page will be indexed does not play a role for the site;
- the new page will change periodically.
Now you know the difference between a 301 and a 302 redirect and will easily determine in which cases it is better to use a permanent redirect and in which cases to use a temporary redirect.
Was the publication informative? Then share it on social networks and join our Telegram channel. We remind you that you can buy Ukrainian hosting from the hosting company CityHost. For technical questions, contact the online chat or call ?? 0 800 219 220.