The difference between HTTP status Codes 301 and 302 and enterprise application cases
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
[[email protected] ~]# curl -s -o /dev/null -i -w "%{http_code}\n " http://www.etiantian.org200[[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.com200[[email protected] ~]# curl -s -o /dev/null -i -w "% {http_code}\n " http://taobao.com302[[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.com302[[email protected] ~]# curl -s -o /dev/null -i -w "%{ Http_code}\n " http://51cto.com301[[email protected] ~]# curl -s -o /dev/null -i -w "%{http_ Code}\n " http://sina.com.cn301
For more information on HTTP status codes, please visit http://oldboy.blog.51cto.com/2561410/716294
This article is from the "Old Boys Linux Training" blog, make sure to keep this source http://oldboy.blog.51cto.com/2561410/1774260
HTTP Status Codes 301 and 302 Concepts simple differences and enterprise application cases