The HyperText Transfer Protocol (HTTP) 308 Permanent Redirect redirect status response code indicates that the resource requested has been definitively moved to the URL given by the Location headers.
The HyperText Transfer Protocol (HTTP) 301 Moved Permanently redirect status response code indicates that the requested resource has been definitively moved to the URL given by the Location headers. A browser redirects to the new URL and search engines update their links to the resource.
The user's search experience may be the same as both options land the user on the appropriate webpage. However, search engines handle these types of URL redirects differently - the 302 redirect means that the page has been moved temporarily and other, 301, means that a new page has taken over permanently.
301 Moved Permanently This and all future requests should be directed to the given URI. 307 Temporary Redirect (since HTTP/1.1) In this case, the request should be repeated with another URI; however, future requests should still use the original URI. Thanks for the answer.
301
, 302
and 307
The RFC 7231, the current reference for semantics and content of the HTTP/1.1 protocol, defines the 301
(Moved Permanently) and 302
(Found) status code, that allows the request method to be changed from POST
to GET
. This specification also defines the 307
(Temporary Redirect) status code that doesn't allow the request method to be changed from POST
to GET
.
See more details below:
6.4.2. 301 Moved Permanently
The
301
(Moved Permanently) 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. [...]Note: For historical reasons, a user agent MAY change the request method from
POST
toGET
for the subsequent request. If this behavior is undesired, the307
(Temporary Redirect) status code can be used instead.
6.4.3. 302 Found
The
302
(Found) status code indicates that the target resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client ought to continue to use the effective request URI for future requests. [...]Note: For historical reasons, a user agent MAY change the request method from
POST
toGET
for the subsequent request. If this behavior is undesired, the307
(Temporary Redirect) status code can be used instead.
6.4.7. 307 Temporary Redirect
The
307
(Temporary Redirect) status code indicates that the target resource resides temporarily under a different URI and the user agent MUST NOT change the request method if it performs an automatic redirection to that URI. Since the redirection can change over time, the client ought to continue using the original effective request URI for future requests. [...]Note: This status code is similar to
302
(Found), except that it does not allow changing the request method fromPOST
toGET
. This specification defines no equivalent counterpart for301
(Moved Permanently) (RFC 7238, however, defines the status code308
(Permanent Redirect) for this purpose).
308
The RFC 7238 has been created to define the 308
(Permanent Redirect) status code, that is similar to 301
(Moved Permanently) but does not allows the request method to be changed from POST
to GET
.
The 308
status code is now defined by the RFC 7538 (that obsoleted the RFC 7238).
3. 308 Permanent Redirect
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. Clients with link editing capabilities ought to automatically re-link references to the effective request URI to one or more of the new references sent by the server, where possible. [...]Note: This status code is similar to
301
(Moved Permanently), except that it does not allow changing the request method fromPOST
toGET
.
Se we have the following:
+-----------+-----------+
| Permanent | Temporary |
+------------------------------------------------------------+-----------+-----------+
| Allows changing the request method from POST to GET | 301 | 302 |
+------------------------------------------------------------+-----------+-----------+
| Doesn't allow changing the request method from POST to GET | 308 | 307 |
+------------------------------------------------------------+-----------+-----------+
Michael Kropat put together a set of decision charts that helps to determine the best status code for each situation. See the following for 2xx
and 3xx
status codes:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With