The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)
obsoleted by
- rfc-9110 — HTTP Semantics
obsoletes
- rfc-7238 — The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)
Extracted elements (10)
RFC 7231 defines 301, 302, and 307 but explicitly does not define a permanent variant of 307 (one that preserves the request method). RFC 7538 adds 308 to fill this gap: the redirect matrix now has both a permanent and temporary variant for method-preserving redirects, mirroring the 301/302 pair for method-changing redirects.
Server implementers are advised not to vary the 308 status code based on request characteristics such as the User-Agent header field ('User-Agent Sniffing'), as this creates code that is hard to maintain and debug and requires special attention to caching (requiring a Vary response header).
Many existing HTML-based user agents will emulate a refresh when encountering an HTML <meta http-equiv='refresh'> directive. Servers can include such a directive in the 308 response body as a fallback for clients that do not recognize the 308 status code.
Per RFC 7231 Section 6, recipients MUST treat unknown 3xx status codes the same as 300 (Multiple Choices). Servers cannot rely on automatic redirection behavior for clients that do not recognize 308; use of 308 should be restricted to clients known to support it or where a fallback to 300 semantics is acceptable.
A 308 response is cacheable by default unless otherwise indicated by the method definition or explicit cache controls (per RFC 7234 Section 4.2.2).
The server SHOULD generate a Location header field in the 308 response containing a preferred URI reference for the new permanent URI.
The user agent MAY use the Location field value for automatic redirection when receiving a 308 response.
The 308 (Permanent Redirect) 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. It is the permanent variant of 307, filling the gap in the redirect matrix by not allowing the request method to change from POST to GET.
The IANA 'Hypertext Transfer Protocol (HTTP) Status Code Registry' has been updated to add value 308 with description 'Permanent Redirect', referencing Section 3 of RFC 7538.
All security considerations that apply to HTTP redirects (RFC 7231 Section 9) apply to the 308 status code. Unsecured communication is subject to man-in-the-middle modification, including changing status codes or redirect targets; use of TLS is recommended to mitigate such attacks.