Dr.Who
← blog

301 vs 302 redirect: use 301 for permanent moves, 302 for temporary ones

· redirects · seo · http

redirectsseohttp

Use a 301 when a URL has moved permanently and a 302 when the move is temporary. A 301 tells browsers and search engines the resource has a new permanent home: browsers cache the redirect aggressively, and search engines drop the old URL from their index, consolidate link equity onto the target, and start showing the new URL. A 302 says "this is temporary" — clients should not cache it, and search engines keep the original URL indexed. Choosing the wrong one quietly costs you rankings or leaves stale URLs cached for months.

What each status code means

Both are redirects, but they signal different intent to the client and to search engines.

HTTP/1.1 301 Moved Permanently
Location: https://www.example.com/new-page
HTTP/1.1 302 Found
Location: https://www.example.com/temporary-page

A 301 Moved Permanently is the canonical "this lives somewhere else now" response. A 302 Found (historically "Moved Temporarily") means the resource is at a different URL for now, so the client should keep using the original.

The SEO consequence follows from that intent. A 301 consolidates ranking signals — links, authority, history — onto the target and swaps the indexed URL. A 302 is treated as "leave the original indexed," so signals stay on the source.

Pick by intent, not by habit

  • Permanent move — domain migration, HTTP to HTTPS, retired URL, slug change, apex to www: use 301. You want the new URL indexed and the old one's equity transferred.
  • Temporary detour — maintenance page, a short-lived promo, geo or device routing, an A/B test, "back soon": use 302. You want the original URL to stay indexed because it is coming back.

The classic mistake is a 302 on a permanent move. Search engines keep the old URL indexed and may not pass full ranking signal to the new one, so the migration underperforms. The reverse mistake — a 301 on a temporary change — bakes the "permanent" answer into browser caches, so visitors keep hitting the temporary target even after you remove the rule.

308 and 307 preserve the HTTP method

301 and 302 have a legacy quirk: many clients change a POST into a GET when following them. That is fine for normal page navigation but wrong for form submissions and APIs. The method-preserving equivalents fix this:

HTTP/1.1 308 Permanent Redirect
Location: https://api.example.com/v2/orders
HTTP/1.1 307 Temporary Redirect
Location: https://api.example.com/maintenance

308 is the permanent, method-preserving counterpart to 301; 307 is the temporary, method-preserving counterpart to 302. Both keep the original method and body intact, so a POST stays a POST. For plain page redirects, 301/302 are still the conventional choice; reach for 308/307 when a method change would break the request.

After you set a redirect, confirm the actual status code on the wire — config and intent can drift. The redirect checker walks the full hop chain and shows each status.

Check your redirect chain →

Further reading