307 vs 308: Temporary Redirect vs Permanent Redirect
307 and 308 can look similar in logs, but they tell clients, crawlers, and API consumers different things.
| Aspect | HTTP 307 — Temporary Redirect | HTTP 308 — Permanent Redirect |
|---|---|---|
| Definition | Unlike 302, a 307 requires the client to repeat the request to the new URL with the same method and body. Use this when method preservation matters for temporary redirects. | Like 301, this signals a permanent move. Unlike 301, the HTTP method must be preserved (a POST stays a POST). Defined in RFC 7538. |
| Plain-language summary | Temporary redirect with mandatory method preservation. The client must repeat the request to the Location URL using the same HTTP method and body. If the original was a POST, the repeat must also be a POST. This is the spec-correct version of 302 for cases where method preservation matters. | Permanent redirect with mandatory method preservation. Like 301, signals a permanent move that crawlers and clients should update their records for. Like 307, requires the client to preserve the HTTP method. The correct choice when you need both permanence and method preservation. |
| When to use | Use 307 when: you need a temporary redirect AND the HTTP method must be preserved (e.g., a POST to /checkout being temporarily routed to /checkout-v2). Use 302 when method preservation does not matter or when you accept the browser's POST→GET behavior. Use 308 for permanent redirects with method preservation. | Use 308 when: the move is permanent AND the HTTP method must be preserved (POST stays POST). Use 301 for permanent moves where method preservation is not required (GET-based navigation, page moves). Use 307 for temporary moves with method preservation. |
| Client behavior | Client repeats the full request (same method, same body, same headers) to the Location URL. Browsers prompt for confirmation before re-sending a POST body. Unlike 302, a POST remains a POST. Not cached. | Client repeats the full request to the Location URL with the same method and body, and updates its internal records (bookmarks, cached redirect). Crawlers follow and transfer SEO signals to the destination. Unlike 301, POST does not become GET. |
| Caching behavior | Not cached by default. Like 302, temporary redirect responses are not stored unless you explicitly add caching headers (rarely appropriate). | Cached by browsers and crawlers like 301. The redirect is permanent and clients should not revisit the original URL. |
| SEO / crawler impact | Search crawlers interpret 307 (redirect-codes) for indexation and link equity accordingly. | Search crawlers interpret 308 (redirect-codes) for indexation and link equity accordingly. |
| API / backend impact | API clients branching on 307 expect Temporary Redirect semantics. | API clients branching on 308 expect Permanent Redirect semantics. |
| Safe to retry? | Follow redirect, then retry original intent | Follow redirect, then retry original intent |
Common real-world scenarios
When you see HTTP 307
Less common than 302 in typical web applications but important in API gateways and service meshes where POST/PUT/DELETE requests need temporary routing changes. Used in HTTPS enforcement where method preservation matters for POST endpoints.
When you see HTTP 308
Used in API versioning (permanently moving POST /api/v1/orders to /api/v2/orders), HTTPS enforcement where POST endpoints are involved, and service architecture migrations where method semantics must be preserved end-to-end.
Decision rule
Use 307 when the response should communicate temporary redirect behavior; use 308 when permanent redirect is the accurate protocol signal.
A frequent mistake is swapping 307 and 308 for convenience; that causes client retry bugs, incorrect cache signals, and misleading monitoring data.
Use 307 when the correct protocol signal is Temporary Redirect. Use 308 when the correct signal is Permanent Redirect. Returning either code for the wrong reason breaks client expectations, cache behavior, and monitoring accuracy.
FAQ
What is the biggest difference between 307 and 308?
307 communicates Temporary Redirect, while 308 communicates Permanent Redirect. Choosing the right one keeps clients and intermediaries predictable.
Do 307 and 308 have SEO or caching impact?
Yes. Search engines and caches interpret status classes differently. Use each code according to its semantics to avoid accidental indexing, stale responses, or crawl inefficiency.
Can APIs safely return 307 instead of 308?
Only when it matches contract semantics. API clients often branch logic by exact code, so swapping them can break retries, auth handling, or user-facing errors.
Full guides
HTTP 307 Temporary Redirect — full guide · HTTP 308 Permanent Redirect — full guide · All comparisons · HTTP 307 status reference · HTTP 308 status reference