What is Redirect 301 and Redirect 302 and what is the difference between them?
9 minute(s) read
Published on: Jan 30, 2021
Updated on: Dec 14, 2021
What is a redirect?
Divert is a common way to change the address of this, in the sense it means to move and redirect to a path and performs redirection and address operations for all types of the site page. To manage the page of your site, it is better to experience such practical experiences in times of need and necessity to better serve your users. In this article, we will talk about the concept, application, types of redirects, and their differences.
In some cases, you may want to move your site from one address to another for different reasons, in which case you should use the redirect technique.
Or, in other cases, suppose you want to delete a page completely and transfer the traffic and traffic to another page, but you may encounter reduced traffic, traffic, and SEO damage. What's the solution? The suggested solution to keep traffic or minimize traffic is to use the divert technique and redirect. This technique transfers your page with all the contents and posts and traffic and visits from one address to another. Of course, you should be aware that you may experience some reduction in traffic.
Types of redirects
This type of diverts is used when it works, and you want to completely delete a page in an address for some reason and transfer all its information and contents to another page. This redirect is used to permanently change the address and path of the pages and permanently redirect the contents of one page to another. Of course, according to Matt Katz, about 15% of page traffic and page rank will not be transferred to the new page, and 75% of the old page traffic will be transferred to the new page. As much as possible, you should try not to need a divertbecause it reduces traffic on the new page by 15% compared to the old page. In this type of diverting, a message is sent to the search engines that the site has changed its address permanently. Permanent can mean a period of one year or more. In other words, search engines index the new address instead of the old address and transfer all rankings and rankings from the old address to the new page address. The old page and address will be erased from search engine memory after a while after it is no longer used and loses its value and credibility.
302 (HTTP 1.0 only):
To better understand divert 302, we must have a correct understanding of the performance of Redirect 301.
This diverts, unlike the 301 redirects, can be used when you temporarily move your page to a page with a new address. For example, you want to clear your page completely and continue working until you create a new page in which case you temporarily transfer the contents of your previous page to another page so that after creating and preparing a new page, your content will be permanently Put it on.
Or in other cases where your page has a problem and needs to be repaired so that you do not delay your users and they do not encounter a static white screen, you can temporarily move the content of your page to a page with another address. Transfer to serve users until your home screen is repaired. Imagine for a second you were transposed into the karmic-driven world of Earl. In this case, if you see your page and site for repair, other users will not be able to access your page, and you will not be able to serve them, which will cause you to lose many users and customers, and you will gain profit, capital, Visiting, you will lose many users. To prevent this from happening, you temporarily redirect your users to a new page and address for service, and this redirect is the same as the 302 redirects.
307 (HTTP 1.1 only):
This diverts used in situations similar to divert 302, except that you want to temporarily redirect your website and content to a page with a different URL, which is compatible with HTTP.1.1. Confirm and transfer. If the search engine does not confirm the incompatibility of the new address with HTTP.1.1, it is better to use 302 redirects.
Hypertext transfer protocol, or HTTP for short, is the protocol on which the Internet is based. This protocol has two different versions for service. Version 1.0 and version 1.1.
Each of these versions has a different function and function and offers a variety of services. Version 1.0 is a version that takes users to a new page with a temporary transfer code, and version 1.1, which has a status found elsewhere, offers a different service to users. Divert 302 is compatible with both versions and works with both, but Redirect 307 only works with version 1.0 temporary transfer status, so the use of diverting 302 is more than 307.
This type of redirect is not like other redirects and is to change the route from the pages and site level to the site server level, this type of redirect causes a lot of damage to the site SEO and is not recommended at all. It may also transfer and reduce a lot of page rank and traffic
Notify user feedback:
When you have created new pages and want to be notified of your user feedback, you can use 302 redirect. You can redirect users to another page using Redirect 302 to review their feedback.
Check the SEO and pages rank without damaging them.
Website owners, people active in the field of SEO and IT and digital marketing, for many of their actions and decisions need to take the AB test, and to perform this test and receive user feedback without damaging the home pages, users to the pages Others are directed to perform the test without having a negative impact on the home screen.
How to use
The following algorithm and trick are used to use 301 redirects and permanently move the pages to the new address.
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
This code snippet causes the old pages to be permanently moved to the new pages and redirected.
Of course, note that instead of the old, you enter the address and path of the previous page, and instead of the new page, you enter the address and path.
A 302 redirect should be used to temporarily redirect and redirect. Here's how to code for a 302 redirect:
Redirect 302 / old-post / https://www.yourwebsite.com/new-post/
This code snippet temporarily moves the old page to the new page and redirects it.
Of course, note that instead of the old page, you enter the address and path of the previous, and instead of the new page, you enter the address and path of the new.
difference 301 and 302
In the explanation given above, we mentioned the difference between 301 and 302 redirects. The main difference is that the 301 redirects are used to permanently move the pages and content to a new address. Of course, in this redirect, because the change of direction is permanent, there is a risk of a 15% reduction in traffic and pages rank. But in contrast, 302 redirects are used to temporarily divert pages, and of course, because the transfer and redirect are temporary, there will be no reduction in pages rank and traffic.
A few notable points in SEO
- All diversions are risky
- Redirecting to HTTPS if compatible is the best divert with the least risk of losing pages rank
- The best way to change the path is to leave all the elements and contents of the pages and only change the pages address (instead of moving the contents and elements to the new pages, change the pages address)
- Reason for using redirects
- To switch from pages to pages with another address, which has been deleted for some reason
- For temporary transfer and display of content in case of site failure
- To change the domain name to another domain
- To convert the site from HTTP to HTTPS
- Improve URL structure
- Remove additional search parameters
- divert in WordPress
There are two ways in WordPress:
In this case, you have to manually, without using a plugin, divert to the .htaccess file.
Using the plugin:
You can use the plugin to change the path in WordPress. To do this, you need to search among plugins to find the right plugin.
1. Use a temporary divert for different versions of the site
2. As we said, 302 divert is used for temporary transfer of site and pages; in case of diverting, you must consider whether the redirect is temporary or permanent. After determining the type of diverting, you can decide which divert is better to use. The important point in redirecting, which will have negative effects on SEO if you do not pay attention, is not using a proper divert due to its temporary or permanent nature.
3. Using 301 redirect after creating a new page: You must note that if you want to permanently and permanently change this and address, you must redirect the pages immediately after the new site is ready, before transferring and inserting the contents of this, so that Add the previous pages rank to this. If you do not follow this point and redirect after transferring content, Google crawlers will consider that pages as new and fresh pages and may not transfer the validity and rank of the previous pages to the new pages.