307 Temporary Redirect
When a resource is temporarily available at a different URL and the original request method must be preserved, the server responds with 307 Temporary Redirect. This status code was introduced in the HTTP/1.1 specification.
Usage
The 307 Temporary Redirect status code indicates the target resource is available at a different URL. The client makes a new request to the URL specified in the Location header and is not permitted to change the request method. This differs from the 302 status code, which allows the client to switch from POST to GET.
When the desired behavior is to change the request method, the 303 status code is the recommended alternative. For example, redirecting a POST form submission to a confirmation page uses 303 with a GET follow-up.
The client must repeat the exact same method, headers, and body to the new URL. The server processes the redirected request normally. Because the 307 Temporary Redirect is not persistent, future requests are expected to use the original URL and revalidate the temporary change.
The permanent counterpart is 308, which preserves the request method identically but signals the move is permanent and clients update stored links.
The response is not cacheable by default. To make the redirect cacheable, add a Cache-Control or Expires header.
The 307 Temporary Redirect status code also serves as an internal redirect when an HSTS policy is declared through the Strict-Transport-Security header or the HSTS preload list. The client uses the status code for redirection from HTTP to a secure connection using HTTPS without contacting the server.
Note
Browsers generate "307 Internal Redirect" in
DevTools when upgrading HTTP to HTTPS via
HSTS. This redirect happens entirely
in the browser with no network request. The
Non-Authoritative-Reason: HSTS header appears
in DevTools. 307 redirect loops between HTTP
and HTTPS indicate conflicting HSTS and
server-side redirect rules. Ensure the server
only redirects on the HTTP port.
Note
303 forces the follow-up request to use GET regardless of the original method, making 303 standard for redirect-after-POST. 307 preserves the original method and body. The client resends the same POST/PUT/PATCH to the new URL.
SEO impact
Google treats a 307 as a weak signal the redirect target is the preferred URL, unlike 301/308 which are strong signals. Google indexes either the source or the target URL. A 307 persisting over a prolonged period is eventually treated as a permanent redirect and ranking signals transfer accordingly.
Example
The client requests a resource and the server responds with 307 Temporary Redirect because the resource is available at an alternate location.
Request
GET /news.html HTTP/1.1
Host: www.example.re
Response
HTTP/1.1 307 Temporary Redirect
Location: http://www.example.re/breaking/news.html
Code references
.NET
HttpStatusCode.TemporaryRedirect
Rust
http::StatusCode::TEMPORARY_REDIRECT
Rails
:temporary_redirect
Go
http.StatusTemporaryRedirect
Symfony
Response::HTTP_TEMPORARY_REDIRECT
Python3.5+
http.HTTPStatus.TEMPORARY_REDIRECT
Apache HttpComponents Core
org.apache.hc.core5.http.HttpStatus.SC_TEMPORARY_REDIRECT
Angular
@angular/common/http/HttpStatusCode.TemporaryRedirect
See also
- RFC 9110: HTTP Semantics
- Google: HTTP status codes and network errors
- 302
- 303
- 308
- Cache-Control
- Expires
- Redirects
- HTTP status codes