302 vs 307
Found vs Temporary Redirect
Redirect Codes: Permanent vs Temporary
Understanding the key differences between redirect types
Classic redirect
Resource has permanently moved. Browsers and search engines will update their bookmarks and indexes.
- Browser caches the redirect
- SEO: Link juice transferred
- ⚠️ May change POST to GET
Method-preserving
Like 301, but guarantees the HTTP method and body won't change during redirect.
- Browser caches the redirect
- SEO: Link juice transferred
- ✓ Preserves HTTP method
Classic temporary
Resource is temporarily at another location. Original URL should still be used in the future.
- No browser caching
- SEO: Original URL preserved
- ⚠️ May change POST to GET
Method-preserving
Like 302, but guarantees the HTTP method and body won't change during redirect.
- No browser caching
- SEO: Original URL preserved
- ✓ Preserves HTTP method
- URL has changed forever
- You want search engines to update their index
- Domain migration or restructuring
- Old URL should never be used again
- Resource is temporarily unavailable
- A/B testing or maintenance mode
- You want to keep the original URL active
- Redirect might change or be removed soon
- Redirecting POST/PUT/DELETE requests
- Request body must be preserved
- Working with REST APIs
- Modern application with strict HTTP semantics
Permanent vs Temporary controls caching and SEO, while Old vs Modern controls HTTP method preservation. For APIs and POST requests, prefer 307/308. For simple page redirects, 301/302 are widely supported and sufficient.
| 🔀 302 | ↪️ 307 | |
|---|---|---|
| Name | Found | Temporary Redirect |
| Category | 3xxRedirection | 3xxRedirection |
| Description | The URI of the requested resource has been changed temporarily. | The server sends this response to direct the client to get the requested resource at another URI with the same method. |
| When to Use |
|
|
| Common Causes |
|
|
The URI of the requested resource has been changed temporarily.
- Legacy compatibility - prefer 307 for temporary redirects in new code
- The redirect is temporary and the original URL should continue to be used
- Warning: Historically changed POST to GET; behavior varies by client
- Temporary maintenance redirect
- A/B testing redirects
- Temporary URL changes
The server sends this response to direct the client to get the requested resource at another URI with the same method.
- Temporary redirect that must preserve the HTTP method (POST stays POST)
- Redirecting form submissions or API calls temporarily
- Preferred over 302 for modern applications
- HTTPS redirect preserving POST data
- Temporary URL change keeping method
- Load balancing redirects
Decision Tree
Is this redirect temporary?
Must the HTTP method be preserved (e.g., POST stays POST)?
Use 307 Temporary Redirect
Status Code: 307
Use 302 Found
Status Code: 302
Use 301 or 308 (see 301-308 decision tree)
Status Code: 301