What is Redirect 301 and Redirect 302 and what is the difference between them?
9 minute(s) read
Jan 30, 2021
What is a redirect?
Redirect is a common way to change the address of pages, in the sense it means to move and redirect to a path, and performs redirection and address operations for all types of site pages. To manage the pages 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 redirect 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 redirect 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 redirects 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 redirect because it reduces traffic on the new page by 15% compared to the old page. In this type of redirect, 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.
Redirect 302 (HTTP 1.0 only):
To better understand
, we must have a correct understanding of the performance of
This redirect, unlike the 301 redirect, 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 302 redirect .
Redirect 307 (HTTP 1.1 only):
This redirect is used in situations similar to Redirect 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 redirect.
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. Redirect 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 Redirect 302 is more than 307.
This type of redirect and redirect is not like other redirects and is to change the route from the page 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
Redirect applications 302
Notify user feedback:
When you have created a new page and want to be notified of your user feedback, you can use
. You can redirect users to another page using Redirect 302 to review their feedback.
Check the SEO and page 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 page, users to the page Others are directed to perform the test without having a negative impact on the home screen.
How to use redirects
The following algorithm and trick is used to use 301 redirect and permanently move the page to the new address.
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
This code snippet causes the old page to be permanently moved to the new page and redirected.
Of course, note that instead of the old page, you enter the address and path of the previous page, and instead of the new page, you enter the address and path of the new page.
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 page, and instead of the newpage, you enter the address and path of the new page.
Redirect 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 redirect is used to permanently move the page 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 page rank. But in contrast, 302 redirect is used to temporarily redirect pages, and of course, because the transfer and redirect is temporary, there will be no reduction in page rank and traffic.
A few notable points in SEO redirects
- All diversions are risky
- Redirecting to https if compatible is the best redirect with the least risk of losing page rank
- The best way to change the path is to leave all the elements and contents of the page and only change the page address (instead of moving the contents and elements to the new page, change the page address)
- Reason for using redirects
- To switch from page to page 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
- Redirect in WordPress
There are two ways to redirect in WordPress:
In this case, you have to manually, without using a plugin, redirect 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.
Common redirect errors
1. Use a temporary redirect for different versions of the site
2. As we said, 302 redirect is used for temporary transfer of site and pages, in case of redirect, you must consider whether the redirect is temporary or permanent. After determining the type of redirect, you can decide which redirect 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 redirect 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 the page and address, you must redirect the page immediately after the new site is ready, before transferring and inserting the contents of the page, so that Add the previous page rank to the main page. If you do not follow this point and redirect after transferring content, Google crawlers will consider that page as a new and fresh page and may not transfer the validity and rank of the previous page to the new page.