301 Moved Permanently
HTTP 301 Moved Permanently 说明请求的资源已经被移动到了由 Location 头部指定的 url 上,是固定的不会再改变。搜索引擎会根据该响应修正。
备注: 尽管规范要求浏览器在收到该响应并进行重定向时不应该修改 http method 和 body,但并非所有的用户代理都符合此要求。所以最好将 301 状态码用作 GET 或 HEAD 方法的响应,而对于 POST 则改用 308 Permanent Redirect,因为此状态码会禁止更改请求方法。
状态
http
301 Moved Permanently
示例
客户端请求
http
GET /index.php HTTP/1.1
Host: www.example.org
服务端响应
http
HTTP/1.1 301 Moved Permanently
Location: http://www.example.org/index.asp
规范
| Specification |
|---|
| HTTP Semantics # status.301 |
浏览器兼容性
BCD tables only load in the browser