(轉)Http狀態碼301和302概念簡單區別及企業應用案例
阿新 • • 發佈:2018-05-03
ash BE light div www oldboy dex -i 地址
Http狀態碼301和302的區別及企業應用案例
原文:http://blog.51cto.com/oldboy/1774260
1、什麽是301重定向?
301重定向/跳轉一般,表示本網頁永久性轉移到另一個地址。
301是永久性轉移(Permanently Moved),SEO常用的招式,會把舊頁面的PR等信息轉移到新頁面;
2、什麽是302重定向?
302重定向表示臨時性轉移(Temporarily Moved ),當一個網頁URL需要短期變化時使用。
3、301重定向與302重定向的區別
301重定向是永久的重定向,搜索引擎在抓取新內容的同時也將舊的網址替換為重定向之後的網址。
302重定向是臨時的重定向,搜索引擎會抓取新的內容而保留舊的網址。因為服務器返回302代碼,搜索引擎認為新的網址只是暫時的。
4、常見網站的應用案例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[root@oldboy ~] # curl -s -o /dev/null -I -w "%{http_code}\n" http://www.etiantian.org
200
[root@oldboy ~] # curl -s -o /dev/null -I -w "%{http_code}\n" http://etiantian.org
200
[root@oldboy ~] # curl -s -o /dev/null -I -w "%{http_code}\n" http://baidu.com 200
[root@oldboy ~] # curl -s -o /dev/null -I -w "%{http_code}\n" http://taobao.com
302
[root@oldboy ~] # curl -s -o /dev/null -I -w "%{http_code}\n" http://qq.com
302
[root@oldboy ~] # curl -s -o /dev/null -I -w "%{http_code}\n" http://jd.com
302
[root@oldboy ~] # curl -s -o /dev/null -I -w "%{http_code}\n" http://51cto.com 301
[root@oldboy ~] # curl -s -o /dev/null -I -w "%{http_code}\n" http://sina.com.cn
301
|
更多http狀態碼知識 請瀏覽http://oldboy.blog.51cto.com/2561410/716294
(轉)Http狀態碼301和302概念簡單區別及企業應用案例