301 Moved Permanently

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

What 301 means

301 tells clients and search engines that a resource has moved for good and that they should update their references. Browsers cache it aggressively - often indefinitely - which is the main practical hazard: a 301 published by mistake is very hard to take back, because clients stop asking.

The other hazard is method rewriting. Historically 301 and 302 permitted a client to change the request method to GET when following the redirect, and virtually all of them do. A redirected POST therefore arrives as a GET with no body, which loses the request silently.

For that reason, use 308 rather than 301 whenever the request might not be a GET. 308 has identical caching semantics and guarantees the method and body survive. 301 remains fine for GET-only redirects and is understood by every client ever written.

For SEO, a 301 passes ranking signals to the new URL and is the correct way to consolidate duplicate URLs or move a site.

Headers this status expects

  • Location - the new URL. Required; a 301 without it is meaningless.

Should a client retry?

Follow the redirect to the Location URL. Clients do this automatically.

FAQ

301 or 308 - which should I use?
308 if the request might not be a GET, because it guarantees the method and body are preserved. 301 is permitted to turn a POST into a GET, and nearly all clients do, silently dropping the body. For permanent GET redirects, 301 is fine and has the broadest support.
301 or 302 for a site move?
301. It is permanent, so clients and search engines update their references and ranking signals transfer. A 302 tells them the move is temporary and to keep using the old URL.
Why can't I undo a 301?
Because browsers cache it, often for a very long time, and stop requesting the old URL at all. Test redirects with a temporary 302 or 307 first, then switch to 301 or 308 once you are certain.

Often confused with