Redirection · 3xx

301 Moved Permanently

The resource has permanently moved to a new URL given in the Location header.

What 301 Moved Permanently means

301 Moved Permanently is the redirect that tells search engines and clients "this URL is dead, use the new one forever". Browsers update bookmarks. Search engines transfer most of the SEO ranking signal to the new URL. CDN edges and HTTP caches cache the redirect aggressively. Use 301 only when you are confident the change is permanent; if there is any chance of moving back, use 302 or 307 instead.

When servers should return it: Return 301 when a URL has permanently changed. Common cases: domain migration, restructuring URL paths, switching from www to apex (or vice versa), HTTP-to-HTTPS upgrades.

Example response

curl -i https://old.example.com/page

HTTP/2 301
location: https://new.example.com/page
cache-control: public, max-age=31536000

Related status codes

Frequently Asked Questions

Does 301 transfer SEO ranking?
Yes. Google has confirmed 301 redirects pass the full ranking signal (or near-full) to the new URL. 302 does not.
Can I change a 301 later?
In theory yes, but browsers and proxies cache 301 aggressively. Users with the old redirect cached will keep going to the new URL until the cache expires (or they clear it). For non-permanent moves, use 302 or 307.
301 vs 308?
301 historically allows the client to change POST to GET on redirect. 308 forbids method change. For modern APIs, 308 is usually safer.
Defined in: RFC 9110 · Class: 3xx Redirection

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.