Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. HTTP
  3. 参考
  4. HTTP 响应状态码
  5. 301 Moved Permanently

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

301 Moved Permanently

HTTP301 Moved Permanently 说明请求的资源已经被移动到了由Location 头部指定的 url 上,是固定的不会再改变。搜索引擎会根据该响应修正。

备注:尽管规范要求浏览器在收到该响应并进行重定向时不应该修改 http method 和 body,但并非所有的用户代理都符合此要求。所以最好将 301 状态码用作GETHEAD 方法的响应,而对于POST 则改用308 Permanent Redirect,因为此状态码会禁止更改请求方法。

状态

http
301 Moved Permanently

示例

客户端请求

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

服务端响应

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

规范

Specification
HTTP Semantics
# status.301

参见

  • 308,当使用的请求方法永远不会更改时,等价于此状态代码。
  • 302,临时重定向

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp