# HTTP 308 永久重定向

**HTTP 308 永久重定向**（HTTP 308 Permanent Redirect）是超文本传输协议中的一种重定向响应状态码，用于告知客户端所请求的资源已被分配新的永久 URI，今后对该资源的任何引用都应使用服务器在响应中给出的 URI 之一。该状态码在 IANA HTTP 状态码注册表中登记，参考文件为 RFC 9110 第 15.4.9 节。<sup>[1](https://www.iana.org/assignments/http-status-codes)</sup> 其决定性特征是方法保留：客户端自动跟随重定向时，不得改变 HTTP 方法，因此 POST 请求到达新地址时仍然是 POST。<sup>[2](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308)</sup>

| 关键事实 | 详情 |
|---|---|
| 代码与类别 | 308，属于 3xx（重定向）状态码；必须采取进一步操作才能完成请求<sup>[1](https://www.iana.org/assignments/http-status-codes)</sup> |
| 现行定义 | RFC 9110（HTTP 语义），第 15.4.9 节，2022 年 6 月<sup>[1](https://www.iana.org/assignments/http-status-codes)</sup> |
| 原始定义 | RFC 7238（2014 年 6 月），由 Julian Reschke 修订为 RFC 7538（2015 年 4 月）；两者均已被 RFC 9110 废止<sup>[3](https://www.rfc-editor.org/info/rfc7538/)</sup> |
| 方法处理 | 方法和正文不变；以 308 重定向的 POST 仍以 POST 重发<sup>[2](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308)</sup> |
| 缓存 | 默认可缓存，除非方法定义或显式缓存控制另有规定<sup>[4](https://www.rfc-editor.org/pdfrfc/rfc7538.txt.pdf)</sup> |
| 最接近的同类 | 301 永久移动，语义相同，区别在于部分客户端会将方法改为 GET<sup>[2](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308)</sup> |

## 语义

使用 308（永久重定向）状态码时，服务器表明目标资源已被赋予新的永久 URI，客户端今后引用该资源时应使用所提供的 URI 之一。具备链接编辑能力的客户端，应尽可能自动将指向有效请求 URI 的引用重新链接到服务器发送的新引用。服务器应当生成一个 Location 头字段，其中包含新永久 URI 的首选 URI 引用；响应负载通常包含一段简短的超文本说明，附有指向新 URI 或多个 URI 的超链接。<sup>[4](https://www.rfc-editor.org/pdfrfc/rfc7538.txt.pdf)</sup>

308 响应默认可缓存，除非方法定义或显式缓存控制另有指示。<sup>[4](https://www.rfc-editor.org/pdfrfc/rfc7538.txt.pdf)</sup> RFC 9110 将 308 列入可启发式缓存的状态码，与 200、301、404 等并列，因此缓存可以按启发式过期规则复用该响应。<sup>[5](https://www.rfc-editor.org/rfc/rfc9110.html)</sup> 这种永久性有一个实际后果：存储了该重定向的客户端将不再请求旧地址，这使得错误的永久重定向难以撤销。<sup>[6](https://.dev/redirects)</sup>

## 方法保留与 301/302 问题

308 之所以存在，是因为规范与浏览器行为之间长期存在不一致。为使用 HTTP 构建协议提供指导的 RFC 9205 指出，Web 浏览器在遇到 301 和 302 时通常会确实将 POST 改为 GET，而 307 和 308 的创建正是为了允许在不改变方法的情况下进行重定向。<sup>[7](https://www.ietf.org/ietf-ftp/rfc/rfc9205.pdf)</sup> 标准出于历史原因允许用户代理在跟随 301 重定向时将请求方法从 POST 改为 GET，如果不希望出现这种行为，可以改用 308 状态码。<sup>[2](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308)</sup><sup> • </sup><sup>[5](https://www.rfc-editor.org/rfc/rfc9110.html)</sup>

因此，四个永久和临时重定向状态码按方法处理方式两两配对。301 和 302 在规范中本应保留方法，但浏览器在跟随时将 POST 变成了 GET，规范后来也接受了这一行为；307 和 308 则补充了本应表达旧状态码原意的状态码。<sup>[8](https://kirkdiamond.com/guides/301-vs-302-vs-307-vs-308)</sup> 在对比表中，MDN 将 308 记为“方法和正文不变”，将 302 Found 记为适用于 GET 方法。<sup>[9](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections)</sup>

这使得 308 成为请求正文很重要时的合适选择。对于接受 POST、PUT 或 DELETE 的 API 端点，使用 308 可确保客户端在跟随重定向时不会悄悄将方法改为 GET；同样的道理适用于任何接受 POST 的 HTTP 到 HTTPS 重定向。<sup>[10](https://tiger.org/codes/308.html)</sup><sup> • </sup><sup>[8](https://kirkdiamond.com/guides/301-vs-302-vs-307-vs-308)</sup> 由于 308 在重定向时保留原始方法，发送到旧位置的 POST 会在新位置以 POST 重发——这一特性使该状态码非常适合表单提交和 API 端点。<sup>[11](https://.dev/308)</sup>

## 历史

该状态码最早在 2014 年 6 月发布的 RFC 7238 中规定，并于 2015 年 4 月以 RFC 7538 修订，语义未变；两份文件均出自 greenbytes 的 Julian Reschke 之手，在 IETF HTTP（HTTPBIS）工作组内编辑完成。<sup>[3](https://www.rfc-editor.org/info/rfc7538/)</sup><sup> • </sup><sup>[12](https://datatracker.ietf.org/doc/html/rfc7238)</sup> RFC 9110 是 HTTP 语义 2022 年 6 月的修订版，废止了 RFC 7538，并将该定义吸收为第 15.4.9 节。<sup>[3](https://www.rfc-editor.org/info/rfc7538/)</sup><sup> • </sup><sup>[5](https://www.rfc-editor.org/rfc/rfc9110.html)</sup> 由于该状态码比其 3xx 同类年轻得多，RFC 7538 中的早期部署指导提醒说，它可能并非在所有地方都能被识别。<sup>[13](https://controlplanelabs.com/http-status/308/)</sup>

针对 RFC 9110 的一项经核实的勘误于 2022 年 8 月报告、2022 年 11 月核实，指出已发布的第 15.4.9 节本身并未像 307 的对应措辞那样声明用户代理不得改变请求方法，并建议补充 RFC 7538 所载的说明；该勘误被归类为编辑性勘误。<sup>[14](https://www.rfc-editor.org/errata/eid7109)</sup>

## 非标准用法

一些 Web 应用将 308 状态码用于重定向以外的目的。[Google Drive](https://www.edgepedia.org/zh/google-drive) 在其可续传上传协议中使用 `308 Resume Incomplete` 响应，向客户端表明未完成的上传已停滞。<sup>[2](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308)</sup>

## References

1. [Hypertext Transfer Protocol (HTTP) Status Code Registry, IANA](https://www.iana.org/assignments/http-status-codes)
2. [308 Permanent Redirect, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308)
3. [RFC 7538: The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect), RFC Editor](https://www.rfc-editor.org/info/rfc7538/)
4. [RFC 7538 (April 2015), Section 3, RFC Editor PDF](https://www.rfc-editor.org/pdfrfc/rfc7538.txt.pdf)
5. [RFC 9110: HTTP Semantics, RFC Editor](https://www.rfc-editor.org/rfc/rfc9110.html)
6. [HTTP Redirections explained, http.dev](https://.dev/redirects)
7. [RFC 9205: Building Protocols with HTTP, IETF](https://www.ietf.org/ietf-ftp/rfc/rfc9205.pdf)
8. [301 vs 302 vs 307 vs 308: choosing the right HTTP redirect, Kirk Diamond](https://kirkdiamond.com/guides/301-vs-302-vs-307-vs-308)
9. [Redirections in HTTP, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections)
10. [308 Permanent Redirect, HTTP Tiger](https://tiger.org/codes/308.html)
11. [308 Permanent Redirect, http.dev](https://.dev/308)
12. [RFC 7238: The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect), IETF Datatracker](https://datatracker.ietf.org/doc/html/rfc7238)
13. [HTTP 308 Permanent Redirect, Control Plane Labs](https://controlplanelabs.com/http-status/308/)
14. [RFC Errata Report, Errata ID 7109, RFC Editor](https://www.rfc-editor.org/errata/eid7109)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 网络与安全 › HTTP与Web通信协议 › HTTP状态码

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/http-308-permanent-redirect

English original: https://www.edgepedia.org/http-308-permanent-redirect
