blob: 8782ef763a2e4c4d913c49f28d7ddce8969ad3fe (
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
50
51
52
53
54
55
56
57
58
59
60
61
|
---
title: 301 Moved Permanently
slug: Web/HTTP/Status/301
tags:
- HTTP
- Redirect
- Reference
- Status code
- ステータスコード
- リダイレクト
translation_of: Web/HTTP/Status/301
---
<div>{{HTTPSidebar}}</div>
<p>The HyperText Transfer Protocol (HTTP) の <code><strong>301 Moved Permanently</strong></code> リダイレクトステータスコードは、リクエストされたリソースが {{HTTPHeader("Location")}} ヘッダーで示された URL へ完全に移動したことを示します。ブラウザーはこのページにリダイレクトし、検索エンジンはリソースへのリンクを更新します (「SEO 用語」では、「リンクジュース」が新しい URL に送られたと言われます)。</p>
<p>リダイレクトが行われるとき、仕様書ではメソッド (と本文) を変更しないよう要求していますが、すべてのユーザーエージェントが従っている訳ではありません。 - まだこの種のバグが発生するソフトウェアが見つかるでしょう。従って、 <code>301</code> のコードは {{HTTPMethod("GET")}} または {{HTTPMethod("HEAD")}} メソッドのみに使用し、このステータスでは明確にメソッドの変更が禁止されているので、 {{HTTPMethod("POST")}} メソッドでは代わりに {{HTTPStatus("308", "308 Permanent Redirect")}} を使用することが推奨されています。</p>
<h2 id="Status" name="Status">ステータス</h2>
<pre class="syntaxbox notranslate">301 Moved Permanently</pre>
<h2 id="Example" name="Example">例</h2>
<h3 id="Client_request" name="Client_request">クライアントリクエスト</h3>
<pre class="notranslate">GET /index.php HTTP/1.1
Host: www.example.org</pre>
<h3 id="Server_response" name="Server_response">サーバーレスポンス</h3>
<pre class="notranslate">HTTP/1.1 301 Moved Permanently
Location: http://www.example.org/index.asp</pre>
<h2 id="Specifications" name="Specifications">仕様書</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">仕様書</th>
<th scope="col">題名</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{RFC("7231", "301 Moved Permanently" , "6.4.2")}}</td>
<td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
<p>{{Compat("http.status.301")}}</p>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
<li>{{HTTPStatus("308", "308 Permanent Redirect")}}</li>
<li>{{HTTPStatus("302", "302 Found")}}: 一時リダイレクト</li>
</ul>
|