What Is 307 Temporary Redirect
Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.
Last updated: April 15, 2026
Key Facts
- The 307 status code was formally defined in RFC 7231 in June 2014
- 307 preserves the original HTTP method, unlike 302 which may change POST to GET
- Search engines do not transfer SEO equity to the new URL during a 307 redirect
- 307 redirects are not cached by default, unlike permanent 301 redirects
- The 307 response must include a 'Location' header specifying the temporary URL
Overview
The 307 Temporary Redirect is an HTTP status code used to indicate that the resource a client is attempting to access has been temporarily relocated to another URL. This redirect ensures that the original HTTP method (such as POST or GET) and message body are preserved, making it particularly useful for APIs and web services.
Unlike permanent redirects like 301, the 307 status explicitly tells clients and intermediaries that the move is temporary and future requests should continue to use the original URL. This behavior is critical in scenarios requiring session persistence or form data integrity.
- Definition: A 307 Temporary Redirect is an HTTP 1.1 status code defined in RFC 7231, replacing earlier ambiguities in 302 handling.
- Preservation of method: Unlike 302 redirects, a 307 ensures that POST requests remain POST after redirection, preventing data loss.
- Use case: Commonly used during website maintenance when backend services are temporarily moved but must retain original request semantics.
- Search engine impact: Google treats 307s as temporary, so original page retains SEO ranking; no link equity is passed to the new URL.
- Header requirement: The server must include a 'Location' header in the 307 response to specify where the client should redirect.
How It Works
When a client sends a request and the server responds with a 307 status, the client is instructed to repeat the same request at a different URL while maintaining the original HTTP method and body. This behavior is crucial for maintaining data integrity in web applications.
- HTTP Method Preservation: The 307 ensures that methods like POST, PUT, or DELETE are not altered during redirection, unlike 302 which historically allowed method changes.
- Client Behavior: Modern browsers and HTTP clients automatically follow the Location header but retain the original request body and headers.
- Server Response: The server returns a 307 status code and must include a Location: https://example.com/temp header to guide the client.
- Cache Policy: By default, 307 redirects are not cached, ensuring clients always check the original URL for future requests.
- Temporary Nature: The redirect implies a short-term move; clients are expected to continue using the original URI after the temporary condition ends.
- Security: Since the request body is preserved, 307s are safer for sensitive operations like authentication or payment processing.
Comparison at a Glance
Understanding how 307 compares to other redirect types clarifies its role in web architecture.
| Redirect Type | Method Preserved? | SEO Impact | Cacheable? | Use Case |
|---|---|---|---|---|
| 307 Temporary Redirect | Yes | No equity transfer | No | Temporary backend migration |
| 302 Found | No (historically) | Temporary indexing | Sometimes | Legacy temporary redirect |
| 301 Moved Permanently | Yes (in modern implementations) | Full equity transfer | Yes | Permanent URL change |
| 303 See Other | No (forces GET) | N/A | No | Post-redirect-after-POST pattern |
| 308 Permanent Redirect | Yes | Full equity transfer | Yes | Permanent move with method preservation |
This comparison highlights that 307 is unique in combining temporary redirection with strict method preservation. While 302 was often misused for this purpose, 307 was introduced to eliminate ambiguity and ensure predictable behavior across clients and servers, especially in RESTful APIs.
Why It Matters
The 307 Temporary Redirect plays a vital role in maintaining the reliability and security of web communications, especially in dynamic environments where backend services shift without altering client expectations.
- API consistency: Ensures REST APIs correctly handle redirects without losing request semantics during service relocations.
- Data safety: Prevents accidental conversion of POST requests to GET, avoiding exposure of sensitive form data in URLs.
- Search engine clarity: Helps prevent SEO dilution by signaling to crawlers that the original page remains authoritative.
- Compliance: Supports standards like RFC 7231, ensuring interoperability across HTTP clients and servers.
- Maintenance flexibility: Allows administrators to move resources temporarily during updates without breaking existing integrations.
- Security posture: Reduces risk of data leakage by preserving original request structure, unlike less strict redirect types.
By enforcing strict adherence to HTTP semantics, the 307 Temporary Redirect provides a reliable mechanism for temporary routing that supports both user experience and backend integrity in modern web applications.
More What Is in Daily Life
Also in Daily Life
More "What Is" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
- WikipediaCC-BY-SA-4.0
Missing an answer?
Suggest a question and we'll generate an answer for it.