HTTP

Comparison

301 vs 302 Redirects

Understand the difference between 301 Moved Permanently and 302 Found redirects. Learn when to use each, how browsers cache them, and their SEO implications.

Bottom line: Use 301 for permanent URL changes (SEO passes, browser caches). Use 302 for temporary redirects (no caching, no link equity transfer).

301 Moved Permanently
vs
302 Found

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

301302
Browser caches redirectYes (indefinitely by default)No
Requires Cache-Control to overrideYesNo
CDN caches redirectUsually yesUsually 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):

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:

When to Use Each

Use 301 when:

Use 302 when:

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.