HTTP 307 Temporary Redirect Status Code

3xx Redirection

Developer reference — method-preserving temporary redirect

What Does HTTP 307 Mean?

The HTTP 307 Temporary Redirect status code is defined in RFC 9110, Section 15.4.8. It indicates that the target resource resides temporarily under a different URI and the user agent must not change the request method when following the redirect.

This status code was introduced to resolve a long-standing ambiguity with HTTP 302. Although the HTTP/1.1 specification required 302 to preserve the request method, most browsers historically changed POST requests to GET when following a 302 redirect. HTTP 307 explicitly guarantees method preservation, making it the correct choice for redirecting POST, PUT, DELETE, and PATCH requests.

The server includes a Location header with the temporary URI. The client should continue using the original URI for future requests because the redirect is temporary and may change.

Common Causes of 307 Temporary Redirect

HSTS (HTTP Strict Transport Security): The most common cause. When a browser has an HSTS policy for a domain (via the Strict-Transport-Security header or HSTS preload list), it internally redirects any HTTP request to HTTPS using a 307. This happens entirely within the browser — no network request reaches the server.

Temporary API migrations: When an API endpoint is temporarily moved to a different server or path, 307 ensures POST/PUT/DELETE requests are forwarded with their body intact, unlike 302 which may drop the body.

Load balancing and failover: Load balancers may return 307 to redirect traffic to a backup server or a different region while preserving the original request method and payload.

A/B testing and canary deployments: Some traffic routing systems use 307 to send a subset of requests to a different backend version while maintaining the integrity of the original request.

HTTP 307 vs HTTP 302: Key Differences

Behavior 302 Found 307 Temporary Redirect
Method preservation Not guaranteed (browsers may change POST to GET) Guaranteed (method and body preserved)
Request body May be dropped on redirect Always preserved
Safe for POST/PUT No (unreliable) Yes
Use case GET redirects (legacy compatibility) Any method, especially POST/PUT/DELETE

For permanent method-preserving redirects, use 308 Permanent Redirect instead of 301.

How to Handle 307 Responses

For Developers

For Server Administrators

HSTS and Internal 307 Redirects

The most common source of 307 redirects in modern browsers is HSTS (HTTP Strict Transport Security). When a site sends the header Strict-Transport-Security: max-age=31536000; includeSubDomains, the browser remembers that this domain should only be accessed over HTTPS.

For subsequent requests, if a user types http://example.com, the browser internally issues a 307 redirect to https://example.com before any network request is made. In Chrome DevTools, this appears as 307 Internal Redirect with a Non-Authoritative-Reason: HSTS header.

This internal redirect is a security feature and should not be "fixed." It protects against SSL stripping attacks by ensuring the browser never sends an unencrypted HTTP request to the domain.

Related Status Codes

Frequently Asked Questions

What does HTTP 307 mean?

HTTP 307 Temporary Redirect is a redirection response. HTTP 307 Temporary Redirect works like 302 but guarantees that the request method and body will not change when following the redirect. If the original request was a POST, the redirected request will

Is HTTP 307 an error?

No, HTTP 307 is a redirection response. Redirection responses (red) indicate further action is needed to complete the request.

How do I fix HTTP 307?

HTTP 307 preserves the request method. If you need a permanent redirect, use 308 instead. If the temporary redirect is causing issues, verify the Location header URL is correct and that the destination server accepts the original HTTP method.

What causes HTTP 307 Temporary Redirect?

The resource is temporarily at a different URL, and the request method must be preserved. Common causes: HSTS HTTP-to-HTTPS redirect, temporary API endpoint relocation, load balancing.

Is HTTP 307 permanent or temporary?

HTTP 307 is temporary. The client can retry the request.

🔍 Check Your IP Address

While you're here, find out your public IP address, location, and ISP details instantly.

Check My IP →