DEV Community

Cover image for 307 Temporary Redirect
Colin McDermott
Colin McDermott

Posted on • Originally published at searchcandy.uk

307 Temporary Redirect

Status

307 Temporary Redirect
Enter fullscreen mode Exit fullscreen mode

What is a 307 Temporary Redirect HTTP Response

A 307 Temporary Redirect HTTP status response code is shown to indicate a resource has moved to a new location, and that the both the method and body of the original request will be reused.

What type of HTTP status is a 307?

A 307 is in the 3xx class of status codes which are redirection based.

Other status codes in the 3xx class include 300, 301, 302, 303, 304, 305, 306, and 308.

307 Redirects and HSTS

307 responses are typical in browsers when a site has HSTS (HTTP Strict Transport Security) in use.

The 307 HTTP response is confirmation that HSTS is working correctly.

Example 307 Response Header

HTTP/1.1 307 Internal Redirect
Location: https://www.searchcandy.uk/
Non-Authoritative-Reason: HSTS
Enter fullscreen mode Exit fullscreen mode

307 response

307, followed by a 200 response in the Chrome network tab

307

Expanded view of a 307 response in Chrome

Does a 307 HTTP response / HSTS affect SEO?

At the time of writing Googlebot does not see or follow 307 redirects -- instead following the actual HTTP to HTTPS redirect that should be in place as part of the HSTS specification.

Using HSTS is unlikely to provide any positive ranking benefit.

Likewise, correct usage of a 307 response/HSTS is extremely unlikely to have any kind of negative impact.

There are situations where using a 307 response may be inappropriate if used incorrectly, or HSTS/redirects set up incorrectly.

Why am I seeing a 307 response in Google Chrome browser but not when I test with other tools?

A 307 Temporary Redirect should be used when a page is redirected to another URL, but the content and method of the new location will remain the same.

If you are seeing a 307 HTTP response when checking a URL in Google Chrome or another browser but not when testing with another tool, it is fairly likely the page is making use of the HSTS specification.

Specification

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).
Enter fullscreen mode Exit fullscreen mode

RFC

RFC 7231, section 6.4.7: 307 Temporary Redirect

Title

Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

Date

June 2014

If you want to check out more status code research and definitions check my SEO glossary here.

Top comments (0)