URL Redirect及Rewrite的实现原理

PS:为什么书上只讲Rewrite规则,不讲Rewrite后面的HTTP协议呢!!


Redirect 过程如下:


Client:

GET /index.php HTTP/1.1
Host: www.example.org

Server:

HTTP/1.1 301 Moved Permanently
Location: http://www.example.org/index.asp

注意:
1. 服务器返回301
2. 客户端需要重新发请求到新URL
3. 服务器返回301时,可以有Body

参考:
1. http://en.wikipedia.org/wiki/HTTP_301
2. http://baike.baidu.com/view/2173220.htm 


你可能感兴趣的:(web)