What 307 means
The resource is temporarily at the URL in the Location header, and the client must repeat the request there with the same method and body. 307 is defined in RFC 9110 §15.4.8. It was created because clients turn a POST into a GET when following a 302; 307 forbids that.
HTTP/1.1 307 Temporary Redirect
Location: https://api2.example.com/v1/upload
A POST of a file to the old URL becomes the same POST, with the same body, to the new one. Like 302, a 307 is temporary: clients keep using the original URL for future requests, and the response isn't cached unless Cache-Control or Expires say so.
| Permanent | Temporary | |
|---|---|---|
| Method may change to GET | 301 | 302 |
| Method and body kept | 308 | 307 |
When to use it
- Temporarily moving an API endpoint or form handler that receives POST, PUT or DELETE.
- Sending requests to another region or server during maintenance or a failover.
- Any temporary redirect where you want precise behaviour; for plain GET pages, 302 and 307 act the same.
The "307 Internal Redirect" in your browser
If DevTools shows 307 Internal Redirect from http:// to https:// (with Non-Authoritative-Reason: HSTS), your server didn't send it. The browser has the site on its HSTS list, from a Strict-Transport-Security header or the preload list, and upgrades the URL itself before any request leaves. Your server might really answer the http:// URL with a 301, a 302 or nothing at all. To see what the server sends, check from a client without HSTS state, such as curl -I or an online checker.
How to send it
nginx: return 307 https://new.example.com$request_uri;. Apache: Redirect 307 /old /new or RewriteRule ^old$ /new [R=307,L]. Cloudflare Redirect Rules offer 307 as a status. Express: res.redirect(307, '/new').
Watch out for clients that can't re-send the body: a library can only repeat a POST if it can read the body again, so streamed uploads may not be followed automatically (Go's http.Client, for example, needs GetBody). curl -L follows a 307 and keeps the method and body. Test the whole flow with the real client.
307 and SEO
Google treats 307 the same as 302: a temporary redirect, a weak signal that the target should be canonical, and the original URL usually stays indexed. For a permanent move of pages, use 301 or 308. The HSTS internal 307 has no SEO effect at all, since Googlebot never sees it.
Related codes
- 302 Found: temporary, method may change.
- 308 Permanent Redirect: the permanent version of 307.
- 303 See Other: temporary, and the client should switch to GET.
See the status your server really sends for each hop, without your browser's HSTS cache, with the Redirect Checker.