The 307, often incorrectly called “307 error” (it is not an error), is an HTTP status code that indicates a temporary redirect. When a web server responds to a request with this code, it tells the client that the requested resource is momentarily at a different address from the original one. Unlike other redirect codes, the 307 requires that the method of the original request be preserved during the new request to the indicated destination.
This characteristic makes it particularly relevant in SEO and in modern web application development, where requests can be of a different type than a simple read. The code belongs to the 3xx class, the one dedicated to redirects, and was introduced with the update of the protocol specifications to fill some ambiguities present in previous codes.
What the 307 code indicates
The 307 code is defined by the technical specifications of the protocol as “temporary redirect”. The server response includes a header that tells the client the address to repeat the request to. The main particularity lies in the fact that the client must keep the request method unchanged: if the initial request was a data submission request, even the request to the new address must use the same method.
This rule distinguishes the 307 from other temporary redirect codes, which in some cases can involve a change of method. The behavior of the 307 is therefore designed to ensure the integrity of the communication, avoiding that data sent by the client are lost or transformed during the passage to the new destination.
307 and the other redirect codes
To fully understand the meaning of the 307 it is useful to compare it with the most common codes of the same family. Redirect codes differ mainly by two criteria: the temporariness or permanence of the redirect and the treatment of the request method.
| Code | Redirect type | Method preserved | Typical use |
|---|---|---|---|
| 301 | Permanent | No, can change | Definitive change of address |
| 302 | Temporary | No, can change | Generic temporary redirect |
| 307 | Temporary | Yes, mandatory | Temporary redirect with non-read methods |
| 308 | Permanent | Yes, mandatory | Definitive change with non-read methods |
When to use the 307
The 307 finds application in scenarios where it is essential that the nature of the original request be maintained. Think of a contact form or a data submission operation: if the server responded with a code that alters the method, the transmitted data might not be processed correctly.
Maintenance and temporary configurations
A frequent case is represented by maintenance interventions or temporary server configurations. In these situations the administrator can decide to route traffic to an alternative page without compromising operations that involve data submission.
Load balancing in web applications
In web applications the 307 can serve to direct requests to specific servers while keeping the original method. The case in which it is encountered most often, however, is another: the “307 Internal Redirect” that the browser generates by itself when a site has activated HSTS and the http request is brought to https without going through the server.
Effects of the 307 on ranking
From an SEO point of view, the 307 is a temporary redirect: for Google it is a weaker signal than a permanent redirect for choosing the new URL as canonical, but it transmits PageRank like the other 3xx redirects. If it stays up for a long time, Google may treat it as permanent.
Why the 301 behaves differently
The 301 code, being permanent, is a strong signal for Google to replace the old URL with the new one in the index. The 307, on the contrary, signals that the situation is temporary. This distinction is crucial to make the URL you want appear in the results.
When it is appropriate to use the 307
It is appropriate to use the 307 only when the redirect is actually temporary. If the change of address is meant to last over time, it is preferable to use a permanent code. Furthermore, it is good practice to ensure that the redirect destination is relevant and does not generate chains of subsequent redirects.
The internal 307 generated by HSTS
If in the browser developer tools you see a 307 “Internal Redirect”, it is not the server responding: the browser, having stored the site’s HSTS rule, goes directly from http to https. It does not appear in the server logs and requires no intervention.
Checks to do before and after configuration
Correct management of this code requires attention both on the server side and on the client side. Below are the main steps for a conscious and safe use.
- Verify that the redirect is really temporary before configuring the 307 code.
- Check that the destination address is correct and reachable.
- Ensure that the method of the original request is preserved along the entire path.
- Avoid redirect chains that can slow down page loading.
- Monitor server logs to identify any unwanted redirects.
- Update the configuration to a permanent code if the change becomes definitive.
- Test the redirect behavior with different types of requests.
- Document active redirects to facilitate future maintenance.
Frequently asked questions about the 307 error
What distinguishes the 307 error from the 302 error?
Both indicate a temporary redirect, but the 307 requires that the method of the original request be maintained, while the 302 in some contexts can involve a change of method.
Does the 307 error damage search engine ranking?
The 307 transmits PageRank like the other 3xx redirects, but it is a weaker signal for choosing the new URL as canonical: the original URL tends to stay in the results. If it is used for a definitive move, better a 301 or a 308.
When is it preferable to use the 308 code instead of the 307?
The 308 code should be used when the redirect is permanent but you still want to preserve the method of the original request, combining stability and integrity of the communication.
Can the 307 be used for data submission requests?
Yes, indeed it is precisely in these cases that the 307 shows its usefulness, because it ensures that the data sent are not altered during the redirect.
How do you configure a 307 redirect on a web server?
You specify the 307 code in the redirect rule. For example, in Apache with mod_alias: Redirect 307 /old /new; in Nginx: return 307 /new;. The exact syntax depends on the server and the CMS.
Which tools allow you to verify the presence of a 307 error?
Response header analysis tools and browser developer panels allow you to identify the status code returned by the server for each request, including the internal 307 generated by the browser with HSTS.
From glossary to projectDo you need to change domain or platform without losing visibility?SEO migration prepares the transition (redirects, structure, checks before and after) to reduce the risk of losing ranking on Google.Discover SEO migration
Related entries:
