301 Moved Permanently vs 302 Found
Use 301 when the old URL is permanently replaced. Use 302 when redirect is temporary and original URL should remain canonical.
| Aspect | 301 Moved Permanently | 302 Found |
|---|---|---|
| When it happens | Emitted when conditions specific to 301 moved permanently occur. | Emitted when conditions specific to 302 found occur. |
| How to tell apart | Identify which layer emitted the code and inspect headers/logs for that layer. | Confirm whether problem is auth/policy, upstream quality, overload, or timeout. |
| Troubleshooting first step | Trace request ID through edge and application logs. | Check deploy/config changes and dependency health in same time window. |
| Practical note | Do not mask this response with generic handlers. | Return explicit headers like Retry-After or auth challenge when relevant. |
When each appears in production
Use CDN/proxy logs to find emission point, then app logs/traces to isolate root cause.
Troubleshooting workflow
Validate routing, policy, and timeout budgets in order. Fix the first failing layer before tuning client retries.
Related guides: 301 Moved Permanently · 302 Found