HTTP 301 Moved Permanently
The resource has been permanently moved to a new URL.
3xx Redirection
301
Moved Permanently
Description
The 301 Moved Permanently status code indicates that the target resource has been assigned a new permanent URI and any future references to this resource ought to use one of the enclosed URIs. The server should generate a Location header field in the response containing a preferred URI reference for the new permanent URI. The user agent may use the Location field value for automatic redirection. The server's response payload usually contains a short hypertext note with a hyperlink to the new URI(s). Clients with link-editing capabilities ought to automatically re-link references to the target URI to one or more of the new references sent by the server.
When Is It Used?
Used when a page or resource has permanently moved to a new URL. Essential for SEO to transfer link equity from the old URL to the new one. Common when restructuring a website, changing domain names, or consolidating duplicate pages.
Example Response
HTTP/1.1 301 Moved Permanently
Location: https://www.example.com/new-page
Content-Type: text/html
<h1>Moved Permanently</h1>
<p>The resource has moved to <a href="https://www.example.com/new-page">here</a>.</p>Related Status Codes
302
Found
The resource resides temporarily under a different URL.
307
Temporary Redirect
The resource temporarily resides under a different URL and the request method must not change.
308
Permanent Redirect
The resource has permanently moved and the request method must not change.
200
OK
The request has succeeded.