307

Temporary Redirect

Official
The ressouce is temporarily available under a new URL. The new call must be based on the same method

Specification of the HTTP status code 307

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.

The server SHOULD generate a Location header field in the response containing a URI reference for the different 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 different URI(s).

Note: This status code is similar to 302 (Found), except that it does not allow changing the request method from POST to GET. This specification defines no equivalent counterpart for 301 (Moved Permanently) ([RFC7238], however, defines the status code 308 (Permanent Redirect) for this purpose).

Source / Quote by: The 307 Temporary Redirect HTTP Status Code is specified by section 6.4.7 of RFC7231.

How to throw a 307 statuscode with PHP?

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

Test the 307 HTTP status code

In order to be able to display the HTTP status code (in this case 307 Temporary 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 307 Temporary Redirect
Overview
URL: https://http-statuscode.com/errorCodeExample.php?code=307
Status: 307 Temporary Redirect
Those: Network
IP address: XX.XX.XX.XX
Status code 307 Temporary Redirect

Browser compatibility of the 307 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

What SEO impact does the 307 status code have?

Array

Constants in programming languages

Response::HTTP_TEMPORARY_REDIRECT
:temporary_redirect
Author: Tony Brüser
Author: Tony Brüser

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

LinkedInGitHub