MDN / 301 Moved Permanently
MDN / 301 Moved Permanently
The HTTP 301 Moved Permanently redirection response status code indicates that the requested resource has been permanently moved to the URL in the header.
A browser receiving this status will automatically request the resource at the URL in the Location 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 the ranking to the new URL.
In the Fetch Standard, when a user agent receives a 301 in response to a request, it uses the method in the subsequent redirection request, as permitted by the HTTP specification. To avoid user agents modifying the request, use instead, as altering the method after a 308 response is prohibited.
Status
301 Moved Permanently
Examples
301 response to a moved resource
The following request is made to a resource with a 301 redirection in place.
GET /en-US/docs/AJAX HTTP/2
Host: developer.mozilla.org
User-Agent: curl/8.6.0
Accept: */*
The response includes the 301 status along with the header that indicates the URL where the resource has moved.
HTTP/2 301
cache-control: max-age=2592000,public
location: /en-US/docs/Learn_web_development/Core/Scripting/Network_requests
content-type: text/plain; charset=utf-8
date: Fri, 19 Jul 2024 12:57:17 GMT
content-length: 97
Moved Permanently. Redirecting to /en-US/docs/Learn_web_development/Core/Scripting/Network_requests
Specifications
See also
equivalent to
301, but the request method is not modifiedtemporary redirect