aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/http/status/308/index.html
blob: 882a5836ea3c8ab199083bc0f26571eddc96286e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: 308 Permanent Redirect
slug: Web/HTTP/Status/308
tags:
  - 响应状态码
  - 重定向
translation_of: Web/HTTP/Status/308
---
<div>{{HTTPSidebar}}</div>

<p>在 HTTP 协议中, <strong>308 Permanent Redirect</strong>(永久重定向)是表示重定向的响应状态码,说明请求的资源已经被永久的移动到了由 {{HTTPHeader("Location")}} 首部指定的 URL 上。浏览器会进行重定向,同时搜索引擎也会更新其链接(用 SEO 的行话来说,意思是“链接汁”(link juice)被传递到了新的 URL)。</p>

<p>在重定向过程中,请求方法和消息主体不会发生改变,然而在返回 {{HTTPStatus("301")}} 状态码的情况下,请求方法有时候会被客户端错误地修改为 {{HTTPHeader("GET")}} 方法。</p>

<div class="note">
<p>一些 Web 应用可能会将 308 Permanent Redirect 以一种非标准的方式使用以及用作其他用途。例如,Google Drive 会使用 308 Resume Incomplete 状态码来告知客户端文件上传终止且不完整。<sup><a href="https://developers.google.com/drive/v3/web/manage-uploads#resumable">[1]</a></sup></p>
</div>

<h2 id="状态">状态</h2>

<pre class="syntaxbox">308 Permanent Redirect</pre>

<h2 id="标准">标准</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">标准</th>
   <th scope="col">标题</th>
  </tr>
  <tr>
   <td>{{RFC("7538", "308 Permanent Redirect" , "3")}}</td>
   <td>The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>

<p>{{Compat("http.status.308")}}</p>

<h2 id="更多可见">更多可见</h2>

<ul>
 <li>{{HTTPStatus("301")}} <code>Moved Permanently</code></li>
 <li>{{HTTPStatus("302")}} <code>Found</code>, the temporary redirect</li>
</ul>