Moved Permanently
ActiveHTTP 301 Moved Permanently indicates the target resource has been assigned a new permanent URI. Defined in RFC 9110 §15.4.2. Clients and search engines should update their references to use the new URI from the Location header.
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 include a Location header field containing the preferred URI reference for the new permanent URI. The response is cacheable by default.
Important for SEO: A 301 passes link equity (ranking power) to the new URL. Search engines will update their index to the new URL.
Examples
GET /old-page HTTP/1.1
Host: example.comHTTP/1.1 301 Moved Permanently
Location: https://example.com/new-page
Content-Length: 0Edge Cases
- •Some clients change POST to GET on redirect. Use 308 if you need the method preserved.
- •Browsers cache 301 redirects aggressively. Incorrect 301s can be very hard to undo.
- •Redirect chains (301→301→301) add latency. Keep chains under 3 hops.
When You'll See This
- →Domain migration (old-domain.com → new-domain.com)
- →URL restructuring (/blog/123 → /articles/123)
- →HTTP to HTTPS migration
- →Removing trailing slashes or normalizing URLs
Implementation References
| Language | Constant |
|---|---|
| Go | http.StatusMovedPermanently |
| Rust | http::StatusCode::MOVED_PERMANENTLY |
| Python | http.HTTPStatus.MOVED_PERMANENTLY |
| Node.js | http.STATUS_CODES[301] |
| .NET | HttpStatusCode.MovedPermanently |
| Java | HttpURLConnection.HTTP_MOVED_PERM |
History
Introduced in HTTP/1.0 (RFC 1945, 1996). The distinction between 301 and 308 was clarified in RFC 7538 (2015) to address the method-changing behavior.
Related Status Codes
Related Headers
FAQ
What is the difference between 301 and 302?
301 is permanent (search engines update their index, link equity passes). 302 is temporary (search engines keep the old URL, no equity transfer).
Does a 301 redirect pass SEO value?
Yes. A 301 redirect passes most link equity to the new URL. Google treats 301s as a signal to replace the old URL in its index.