(Transfer) Simple difference between Http status codes 301 and 302 concepts and enterprise application cases

The difference between Http status codes 301 and 302 and enterprise application cases

 Original: http://blog.51cto.com/oldboy/1774260

1. What is a 301 redirect?

  301 redirects/jumps are general, indicating that this webpage is permanently transferred to another address.

    301 is Permanently Moved, a common SEO move, which will transfer the PR and other information of the old page to the new page;

 

2. What is a 302 redirect?

  302 Redirect means Temporarily Moved and is used when a web page URL needs to change for a short period of time.

 

3. The difference between 301 redirect and 302 redirect

   A 301 redirect is a permanent redirect where search engines crawl new content and replace the old URL with the redirected URL.

   302 redirects are temporary redirects where search engines crawl new content while keeping old URLs. Because the server returns a 302 code, the search engine considers the new URL to be temporary.

 

4. Application cases of common websites

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[[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 http status code knowledge, please visit http://oldboy.blog.51cto.com/2561410/716294

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325172190&siteId=291194637