您可以将Location
标头与3xx-range中的响应代码一起使用。
举个例子:
HTTP/1.1 302 Found
Location: /my/server/page.html
301
和302
HTTP代码可用于重定向请求,如下所示:
HTTP/1.1 302 Object moved
Date: Fri, 28 Oct 2011 10:37:34 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Location: http://www.xyz.com/abc