301Moved Permanently
This URL has moved for good, and everything pointing at it should be updated to the new address.
Browse all HTTP status codesWhen you see it
The right code for a permanent move: a renamed page, a domain change, forcing HTTPS, or collapsing www and non-www onto one hostname. Browsers cache it aggressively and search engines transfer ranking signals to the new URL, which is exactly what you want when the move is genuine.
What to watch out for
Because browsers cache 301s, a mistake is unusually expensive. A visitor who received a wrong 301 keeps following it even after you fix the server, sometimes for a very long time, and clearing it means clearing their browser cache. Test a redirect as a 302 first, then promote it to 301 once it is proven.
The other trap is method rewriting: many clients turn a POST into a GET when following a 301. If the redirected request needs to stay a POST, use 308 instead.
Often confused with
302 Found
The difference is permanence. 301 says update your records and is cached hard; 302 says use this other URL just for now and keep asking for the original. Search engines pass ranking through a 301 and largely hold it at a 302.
308 Permanent Redirect
308 is a 301 that additionally guarantees the method and body are preserved. If the request is a POST and must stay one, 308 is the correct code.
Look up another one
Open
Type a code, a partial code like 40, or any word from a name or description. Everything runs in your browser.
69 of 69 codes. Click a row to copy it.