Why Redirects Matter
Choosing the wrong redirect type can break SEO rankings, cause caching issues, or change POST requests into GET requests unexpectedly.
The Four Redirect Codes
301 Moved Permanently
The resource has permanently moved. Search engines transfer link equity to the new URL. Browsers cache this redirect aggressively. Use for: domain changes, URL restructuring, removing trailing slashes.
302 Found
A temporary redirect. Search engines keep indexing the original URL. Caveat: Some older clients may incorrectly change POST to GET. Use for: A/B testing, temporary maintenance pages, geo-based routing.
307 Temporary Redirect
Like 302 but explicitly preserves the HTTP method. A POST request stays POST after redirect. Use for: temporary redirects where method preservation is critical (API endpoints).
308 Permanent Redirect
Like 301 but explicitly preserves the HTTP method. Use for: permanent URL changes for API endpoints that accept POST/PUT/DELETE.
SEO Impact
| Code | SEO Equity Transfer | Cached by Browser | Method Preserved |
|---|---|---|---|
| 301 | Yes | Yes | No (may change to GET) |
| 302 | No | No | No (may change to GET) |
| 307 | No | No | Yes |
| 308 | Yes | Yes | Yes |
Best Practice
For websites: use 301 for permanent moves, 302 for temporary ones. For APIs: prefer 307/308 to guarantee method preservation.