HTTP 301 vs 302 — Moved Permanently vs Found Comparison
http 301 vs 302: 301 is permanent and transfers SEO link equity, 302 is temporary. Learn the right choice for redirects and how Google, browsers, and CDNs treat each.
Quick Cheat Sheet
| Aspect | 301 Moved Permanently | 302 Found (Temporary) |
|---|---|---|
| Permanence | Permanent | Temporary |
| Cacheable by default | Yes, aggressively | No (unless headers say so) |
| SEO link equity transfer | Yes — pass PageRank | No (mostly) |
| Method preservation | Historically buggy | Historically buggy |
| Modern strict equivalent | 308 | 307 |
The Core Difference
301 Moved Permanently (RFC 9110 § 15.4.2) tells the client and search engines that the resource has been permanently relocated. Future requests should go directly to the new URL — the old URL is essentially deprecated.
302 Found (RFC 9110 § 15.4.3) signals a temporary redirection. The original URL is still the canonical one; the client just needs to follow the redirect this time. Future requests should still go to the original URL.
SEO Implications (The Big One)
This is the reason developers care about 301 vs 302:
- 301 transfers PageRank / SEO authority from the old URL to the new one (Google: "we treat 301s as permanent and consolidate signals").
- 302 does not transfer SEO authority by default. The old URL retains its ranking value, and Google may eventually start indexing the new URL as a duplicate, hurting both.
If you're moving a domain, restructuring URLs, or merging duplicate pages — always 301. Using 302 for permanent moves is one of the most common SEO mistakes.
Caching Behavior
301 is heuristically cacheable forever by default. This bites people: if you accidentally 301 to the wrong URL and clients cache it, those users may never hit your origin again until their cache expires (which could be weeks or never).
302 is not cacheable unless you explicitly send Cache-Control: max-age=N. This makes it safer for short-lived redirects.
The Method-Preservation Wart
Both 301 and 302 historically have an ugly history: many user agents convert POST to GET when following the redirect, which is technically against the original RFCs but became standard practice. RFC 9110 codifies this as MAY behavior.
If you need strict method preservation for POST/PUT/DELETE redirects, use 308 (permanent) or 307 (temporary) instead. These were specifically created to fix this issue.
When to Use Which
- 301: moving a domain, renaming a URL slug, merging duplicate pages, deprecating old paths
- 302: A/B test routing, geo-based redirects, short-lived maintenance redirects, login redirects to original URL after auth
Real-World Examples
- Migrating from
example.com/blog/post-1toexample.com/articles/post-1→ 301 - Geo-redirecting EU users to
/eubased on IP → 302 - After login, sending users back to the page they wanted → 302 / 303
Real-World Use Case
When migrating a site to a new domain, configure 301 redirects in Nginx (return 301 https://newsite.com$request_uri;) so SEO equity transfers and Google deindexes the old URLs. For a login flow that returns users to the page they were on, use 302 with a query parameter — never 301, because tomorrow the same login URL might redirect somewhere else.
Look Up Any Status Code
Related Comparisons
HTTP 301 vs 308 — Permanent Redirect & Method Preservation Comparison
http 301 vs 308: both are permanent redirects, but 308 strictly preserves the request method (POST stays POST). When to choose each for APIs vs web pages.
HTTP 302 vs 307 — Temporary Redirect & Method Preservation Comparison
http 302 vs 307: both are temporary redirects, but 307 strictly preserves the HTTP method. When 307 fixes broken POST redirects in APIs and OAuth flows.
HTTP 303 vs 302 — See Other vs Found Status Code Comparison
http 303 vs 302: 303 is the canonical 'POST/Redirect/GET' code that always converts to GET, while 302 is ambiguous. Why 303 fixes form-resubmission in modern web apps.
HTTP 404 vs 410 — Not Found vs Gone Status Code Comparison
http 404 vs 410: Not Found means the resource may exist later, while Gone signals permanent deletion. Learn how Google indexing, CDN caching, and SEO are affected.