The Core Difference
Both status codes tell the client to fetch a resource from a different URL. The difference is permanence — and that single distinction has cascading effects on caching, SEO, and browser behavior.
301 Moved Permanently signals that the resource has moved to a new location indefinitely. The client should update its bookmarks, links, and caches to use the new URL going forward.
302 Found signals a temporary redirect. The client should follow the redirect this time, but continue using the original URL for future requests.
Caching Behavior
| 301 | 302 | |
|---|---|---|
| Browser caches redirect | Yes (indefinitely by default) | No |
Requires Cache-Control to override | Yes | No |
| CDN caches redirect | Usually yes | Usually no |
A 301 without an explicit Cache-Control header will be cached by browsers indefinitely. This means if you redirect /old-page → /new-page with a 301, users who visited before will never hit your server again for /old-page — their browser goes straight to /new-page.
This is powerful but dangerous: if you need to change the redirect destination later, cached users won’t see the update until their cache expires or they clear it.
A 302 is never cached by default. Every request to the original URL will hit your server and receive the redirect response fresh.
SEO Implications
Search engines treat 301 and 302 differently when deciding how to handle link equity (PageRank):
- 301: Link equity from the original URL is transferred to the destination. The original URL is eventually deindexed and replaced by the destination in search results.
- 302: Link equity stays with the original URL. The destination is treated as a temporary location. The original URL remains indexed.
If you’re migrating a site or permanently changing URL structure, use 301. Using 302 for permanent moves means you lose the SEO value of inbound links pointing to the old URL.
Method Preservation
Both 301 and 302 have a historical quirk: browsers historically changed POST requests to GET when following these redirects, even though the spec didn’t require it.
If you need to preserve the HTTP method across a redirect:
- Use 307 Temporary Redirect instead of 302
- Use 308 Permanent Redirect instead of 301
When to Use Each
Use 301 when:
- You’ve permanently moved a page to a new URL
- You’re migrating a domain
- You’re consolidating duplicate URLs (e.g.,
http://→https://,www.→ non-www) - You want search engines to transfer link equity
Use 302 when:
- You’re temporarily redirecting during maintenance
- You’re A/B testing different landing pages
- You’re redirecting based on user state (e.g., login required) and the original URL should remain canonical
- You’re not sure yet if the move is permanent
Common Mistakes
Using 302 for permanent moves — the most common mistake. Developers reach for 302 because it feels “safer” (it’s reversible), but for permanent URL changes it means losing SEO value and not getting browser caching benefits.
Forgetting 301s are cached forever — if you set up a 301 and later need to change the destination, users with cached redirects won’t see the change. Always set Cache-Control: max-age=3600 on 301s during a migration period, then remove the header once you’re confident.
Using 301/302 when you need method preservation — if your form POSTs to /submit and you redirect to /thank-you, use 303 See Other (which always converts to GET) rather than 302.