The difference between HTTP status Codes 301 and 302 and enterprise application cases
Original: http://blog.51cto.com/oldboy/1774260
1. What is 301 redirect?
301 Redirect/Jump generally means that this page is permanently transferred to another address.
301 is a permanent transfer (permanently Moved), SEO commonly used moves, will be the old page of PR and other information transfer to the new page;
2. What is 302 redirect?
The 302 redirect represents a temporary transfer (temporarily Moved), which is used when a Web page URL needs a short-term change.
3, 301 redirect and 302 redirect Difference
301 redirects are permanent redirects, and search engines also replace old URLs with redirected URLs while crawling new content.
302 redirects are temporary redirects, and search engines crawl new content and keep the old URLs. Because the server returns 302 code, the search engine thinks the new URL is only temporary.
4. Application cases of common websites
12345678910111213141516 |
[[email protected] ~]
# curl -s -o /dev/null -I -w "%{http_code}\n" http://www.etiantian.org
200
[[email protected] ~]
# curl -s -o /dev/null -I -w "%{http_code}\n" http://etiantian.org
200
[[email protected] ~]
# curl -s -o /dev/null -I -w "%{http_code}\n" http://baidu.com
200
[[email protected] ~]
# curl -s -o /dev/null -I -w "%{http_code}\n" http://taobao.com
302
[[email protected] ~]
# curl -s -o /dev/null -I -w "%{http_code}\n" http://qq.com
302
[[email protected] ~]
# curl -s -o /dev/null -I -w "%{http_code}\n" http://jd.com
302
[[email protected] ~]
# curl -s -o /dev/null -I -w "%{http_code}\n" http://51cto.com
301
[[email protected] ~]
# curl -s -o /dev/null -I -w "%{http_code}\n" http://sina.com.cn
301
|
For more information on HTTP status codes, please visit http://oldboy.blog.51cto.com/2561410/716294
Go HTTP Status Codes 301 and 302 Concepts simple differences and enterprise application cases