blob: a2dcab9a0deea3514600ef04054518c9fb82a30a (
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
|
---
title: 301 Kalıcı Yönlendirme
slug: Web/HTTP/Status/301
translation_of: Web/HTTP/Status/301
---
<div>{{HTTPSidebar}}</div>
<p>The HyperText Transfer Protocol (HTTP) <code><strong>301 Moved Permanently</strong></code> redirect status response code indicates that the resource requested has been definitively moved to the URL given by the {{HTTPHeader("Location")}} headers. A browser redirects to this page and search engines update their links to the resource (in 'SEO-speak', it is said that the 'link-juice' is sent to the new URL).</p>
<p>Even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents align with it - you can still find this type of bugged software out there. It is therefore recommended to use the <code>301</code> code only as a response for {{HTTPMethod("GET")}} or {{HTTPMethod("HEAD")}} methods and to use the {{HTTPStatus("308", "308 Permanent Redirect")}} for {{HTTPMethod("POST")}} methods instead, as the method change is explicitly prohibited with this status.</p>
<h2 id="Status">Status</h2>
<pre class="syntaxbox notranslate">301 Moved Permanently</pre>
<h2 id="Example">Example</h2>
<h3 id="Client_request">Client request</h3>
<pre class="notranslate">GET /index.php HTTP/1.1
Host: www.example.org</pre>
<h3 id="Server_response">Server response</h3>
<pre class="notranslate">HTTP/1.1 301 Moved Permanently
Location: http://www.example.org/index.asp</pre>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Title</th>
</tr>
<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">Browser compatibility</h2>
<p>{{Compat("http.status.301")}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li>{{HTTPStatus("308", "308 Permanent Redirect")}}</li>
<li>{{HTTPStatus("302", "302 Found")}}, the temporary redirect</li>
<li><a href="https://www.exai.com/blog/301-redirects">301 Redirect </a></li>
</ul>
|