301 Moved Permanently
The HTTP301 Moved Permanentlyredirection response status code indicates that the requested resource has been permanently moved to the URL in theLocation header.
A browser receiving this status will automatically request the resource at the URL in theLocation header, redirecting the user to the new page.Search engines receiving this response will attribute links to the original URL to the redirected resource, passing theSEO ranking to the new URL.
Note:In theFetch Standard, when a user agent receives a301 in response to aPOST request, it uses theGET method in the subsequent redirection request, as permitted by the HTTPspecification.To avoid user agents modifying the request, use308 Permanent Redirect instead, as altering the method after a308 response is prohibited.
In this article
Status
301 Moved PermanentlyExamples
>301 response to a moved resource
The followingGET request is made to a resource with a301 redirection in place.
GET /en-US/docs/AJAX HTTP/2Host: developer.mozilla.orgUser-Agent: curl/8.6.0Accept: */*The response includes the301 status along with theLocation header that indicates the URL where the resource has moved.
HTTP/2 301cache-control: max-age=2592000,publiclocation: /en-US/docs/Learn_web_development/Core/Scripting/Network_requestscontent-type: text/plain; charset=utf-8date: Fri, 19 Jul 2024 12:57:17 GMTcontent-length: 97Moved Permanently. Redirecting to /en-US/docs/Learn_web_development/Core/Scripting/Network_requestsSpecifications
| Specification |
|---|
| HTTP Semantics> # status.301> |
See also
- Redirections in HTTP
- HTTP response status codes
308 Permanent Redirectequivalent to301, but the request method is not modified302 Foundtemporary redirect