Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1105325 of 301 Moved Permanently

  • Revision slug: Web/HTTP/Status/301
  • Revision title: 301 Moved Permanently
  • Revision id: 1105325
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{HTTPSidebar}}

The HTTP 301 Moved Permanently redirect status response code indicates that the resource requested has been definitively moved to the URL given by the {{HTTPHeader("Location")}} headers. Browser redirects to this page, and search engines updates their link to the resource (In SEO-speak, it is said that the link-juice is sent to the new URL).

Even if the specification requires the method, and the body, not to be altered when the redirection is performed, not all user-agents did it, and you can still find buggy software out there. It is therefore recommended to the 301 code only as a return for {{HTTPMethod("GET")}} or {{HTTPMethod("HEAD")}} methods an to use {{HTTPStatus("308")}} Permanent Redirect instead, as the method change is explicitly prohibited in that case.

Status

301 Moved Permanently

Specifications

Specification Title
{{RFC("7231", "301 Redirect Permanently" , "6.4.2")}} Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

Browser compatibility

{{Compat}}

See also

  • {{HTTPStatus("307")}} Permanent Redirect
  • {{HTTPStatus("302")}} Found, the temporary redirect

Revision Source

<div>{{HTTPSidebar}}</div>

<p>The HTTP <code><strong>301</strong></code><strong><code> Moved Permanently</code></strong> redirect status response code indicates that the resource requested has been definitively moved to the URL given by the {{HTTPHeader("Location")}} headers. Browser redirects to this page, and search engines updates their link 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 did it, and you can still find buggy software out there. It is therefore recommended to the <code>301</code> code only as a return for {{HTTPMethod("GET")}} or {{HTTPMethod("HEAD")}} methods an to use {{HTTPStatus("308")}} <code>Permanent Redirect</code> instead, as the method change is explicitly prohibited in that case.</p>

<h2 id="Status">Status</h2>

<pre class="syntaxbox">
301 Moved Permanently</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 Redirect 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 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/README.md">https://github.com/mdn/browser-compat-data/README.md</a> and send us a pull request.</p>

<p>{{Compat}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{HTTPStatus("307")}} <code>Permanent Redirect</code></li>
 <li>{{HTTPStatus("302")}} <code>Found</code>, the temporary redirect</li>
</ul>
Revert to this revision