Permanent Redirect

The ressouce is available in perpetuity at a new URL. All future requests should be made via the new URL

Specification of the HTTP status code 308

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 (Section 5.5 of [RFC7230]) to one or more of the new references sent by the server, where possible.

The server SHOULD generate a Location header field ([RFC7231], Section 7.1.2) in the response containing a preferred URI reference for the new permanent URI. The user agent MAY use the Location field value for automatic redirection. The server's response payload usually contains a short hypertext note with a hyperlink to the new URI(s).

A 308 Permanent Redirect response is cacheable by default; i.e., unless otherwise indicated by the method definition or explicit cache controls (see [RFC7234], Section 4.2.2).

Note: This status code is similar to 301 (Moved Permanently) ([RFC7231], Section 6.4.2), except that it does not allow changing the request method from POST to GET.

Source / Quote by: The 308 Permanent Redirect HTTP Status Code is specified by section 3 of RFC7238.


work in progress

How to throw a 308 statuscode with PHP?

To throw the HTTP status code 308 on a web page, the PHP function http_response_code can be used. The syntax is as follows: http_response_code(308) (PHP 5 >= 5.4.0, PHP 7, PHP 8)

Test the 308 HTTP status code

In order to be able to display the HTTP status code (in this case 308 Permanent Redirect) and other information on the client side, the development console must be opened with F12. Afterwards you have to navigate to the tab "Network". Now you can open the page, in the network tab you should see the web page (example index.php). This must be selected and then the Herder section must be selected. Here the user will see the following result:

Status code 308 Permanent Redirect
URL: https://http-statuscode.com/errorCodeExample.php?code=308
Status: 308 Permanent Redirect
Those: Network
IP address: XX.XX.XX.XX
Status code 308 Permanent Redirect

Browser compatibility of the 308 status code

Chrome Yes
Edge Yes
Firefox Yes
Opera Yes
Safari Yes
Chrome Android Yes
Firefox for Android Yes
Opera Android Yes
Safari on iOS Yes
Internet Yes
WebView Android Yes

Constants in programming languages

Author: Tony Brüser
Author: Tony Brüser

Tony Brüser is an enthusiastic web developer with a penchant for HTTP status codes.