ietf-corpus

rfc-7538

The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)

J. Reschke
date2015-04 streamIETF areawit wghttpbis statusPROPOSED STANDARD pages6 canonicalhttps://www.rfc-editor.org/rfc/rfc7538 doi10.17487/RFC7538
This document specifies the additional Hypertext Transfer Protocol (HTTP) status code 308 (Permanent Redirect).

obsoleted by

obsoletes

Extracted elements (10)

design-rationale §1

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.

http

design-rationale §4

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).

http

interoperability-note §4

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.

http

interoperability-note §4

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.

http

normative-requirement §3 OPTIONAL

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).

http

normative-requirement §3 SHOULD

The server SHOULD generate a Location header field in the 308 response containing a preferred URI reference for the new permanent URI.

http

normative-requirement §3 MAY

The user agent MAY use the Location field value for automatic redirection when receiving a 308 response.

http

protocol-element §3

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.

http

registry §6

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.

http, registry

security-consideration §5

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.

http, security, tls