HTTP 3xx redirect status codes
The 3xx class tells the client that further action — usually following a Location URL — is needed to complete the request. The nuances matter: some redirects are permanent and pass SEO signals, others are temporary; some preserve the original HTTP method and body, others quietly rewrite it to GET. Pick the wrong one and you can break a POST, lose search rankings, or create redirect loops. Search the reference above by code or keyword to compare permanence, method handling, and caching.
How it works
A redirect response carries a Location header pointing to the new target. The browser then issues a fresh request to that URL. Two independent dimensions distinguish the codes. First, permanence: 301/308 are permanent (update bookmarks, transfer ranking), while 302/303/307 are temporary. Second, method preservation: 307 and 308 guarantee the method and body survive the redirect, 303 always switches to GET, and 301/302 historically allowed POST→GET rewrites that differ across clients. 304 Not Modified is the odd one out — it is part of conditional requests and caching, not navigation, and returns no body.
Tips and examples
- For an HTTP→HTTPS upgrade or a permanent domain move, prefer
308soPOSTrequests are not silently downgraded, and so engines pass ranking to the canonical URL. - After a form
POST, respond with303 See Otherto the confirmation page; refreshing then re-fetches that page withGETinstead of resubmitting. - Support conditional requests: emit
ETag/Last-Modifiedand answer matchingIf-None-Match/If-Modified-Sincewith304to cut bandwidth. - Avoid chains: redirecting A→B→C wastes round trips and dilutes link equity. Point every old URL directly at the final destination.