The difference between 301 and 302 in the HTTP return code (reprint)

Source: Internet
Author: User

A Official statement
301,302 is the encoding of the HTTP state, which means that a URL has been shifted, except That:
301 redirect:301 represents a permanent transfer (permanently Moved).
302 redirect:302 represents a temporary transfer (temporarily Moved).
This is a very official statement, so what is the difference between them?

Two. The difference in reality
2.1. for users
301,302 is no different for users, they see the effect is just a jump, the old URL in the browser becomes the new url. The page jumps to the place where this new URL Points.
2.2. for the engine and the webmaster
2.2.1 302
302 Steering may have URL normalization and URL hijacking issues. May be judged by search engines as a suspicious turn, or even as Cheating.
URL Normalization
see: http://www.chinamyhosting.com/seoblog/2006/04/10/ url-canonicalization/
URL Hijacking
302 redirect and URL hijacking (url hijacking) what does it matter? This is going to start with how the search engine handles 302 Turns. From the definition of a 302 redirect to URL b from URL a, The host server implies that URL a may change its mind at any time, re-display its own content or move to another place. Most of the search engines in most cases, when received 302 redirect, generally as long as to crawl the destination url, that is, URL B.
in fact, if the search engine encounters a 302 turn, 100% of the target URL b crawl, You do not have to worry about URL Hijacking. The problem is that sometimes search engines, especially google, don't always crawl the target Urls. Why is it? For example, sometimes a URL is very short, but it does a 302 redirect to the B url, and the B URL is a long, messy url, and may even contain some questions such as question Marks. naturally, A Web site is more user-friendly, while the B URL is both ugly and user-friendly. It is likely that Google will still show URL A.
because the search engine ranking algorithm is only a program and not a person, when encountering 302 redirects, and can not be like a person to determine exactly which URL is more appropriate, which caused the site URL hijacking the Possibility. That is, an immoral person in his own URL A to do a 302 redirect to your URL b, for some reason, the  google search results are still displayed in URL a, but the content of the Web page is the content of your URL b, which is called URL Hijacking. Your hard-earned content was stolen by Others.

2.2.2 301
When page A is redirected to page B with a 301 redirect, the search engine can confirm that page a permanently changes position, or that it does not exist, and that the search engine will treat page B as the only valid Target.
The 301 Benefits Are:
first, There is no URL normalization Issue.
second, It is also important that page A's PR page level will be uploaded to Page B.

The difference between 301 and 302 in the HTTP return code (reprint)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.