What does permanent forwarding mean 308

What is the difference between the HTTP 301 and 308 status codes?


Reply:


An overview of, and

The RFC 7231, the stream reference for the semantics and content of the HTTP / 1.1 protocol, defines the (permanently moved) and (found) status code that allows the request of procedures to be changed to. This specification also defines the status code (temporary redirection) with which the request method cannot be changed from to.

Please see below for more details:

6.4.2. 301 Postponed permanently

The status code (permanently moved) indicates that the target resource has been assigned a new permanent URI and all future references to that resource should use one of the attached URIs. [...]

Note: For historical reasons, a user agent can change the request method from to for the subsequent request. If this behavior is undesirable, the status code (Temporary redirection) can be used instead.

6.4.3. 302 found

The status code (Found) indicates that the target resource is temporarily under a different URI. Since the redirect can be changed from time to time, the client should continue to use the effective request URI for future requests. [...]

Note: For historical reasons, a user agent can change the request method from to for the subsequent request. If this behavior is undesirable, the status code (Temporary redirection) can be used instead.

6.4.7. 307 Temporary forwarding

The status code (Temporary Redirection) indicates that the target resource is temporarily under a different URI and the user agent is NOT allowed to change the request method when performing an automatic redirection to this URI. Because the redirect can change over time, the client should continue to use the original effective request URI for future requests. [...]

Note: This status code is similar to (Found) except that the request method cannot be changed from to. This specification does not define an equivalent counterpart for (permanently moved) (however, RFC 7238 defines the status code (permanent redirection) for this purpose).

The need for

RFC 7238 was created to define the status code (Permanent Redirect) which is similar to (Permanently Moved) but does not allow the request method to be changed from to.

The status code is now defined by RFC 7538 (which superseded RFC 7238).

3. 308 Permanent forwarding

The status code (Permanent Redirect) indicates that the target resource has been assigned a new permanent URI and all future references to that resource should use one of the URIs included. Clients with link-handling capabilities should automatically associate references to the effective request URI with one or more of the new references sent by the server whenever possible. [...]

Note: This status code is similar to (permanently moved) except that the request method cannot be changed from to.

Se we have the following:

Choosing the most suitable status code

Michael Kropat has put together a number of decision diagrams that can help identify the best status code for any situation. See the following for and status codes:






We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By continuing, you consent to our use of cookies and other tracking technologies and affirm you're at least 16 years old or have consent from a parent or guardian.

You can read details in our Cookie policy and Privacy policy.