301 vs 302 Redirect: Which to Use and When
Use a 301 when a URL has moved for good, because search engines transfer the old page's ranking signals to the new one. Use a 302 only when the move is genuinely temporary, because it tells search engines to keep indexing and ranking the original URL.
Both codes send a visitor from one URL to another. To a person they look identical: you click, you land somewhere else. To a search engine they mean opposite things, and picking the wrong one is one of the quietest ways to lose rankings.
The difference in one line each
301 Moved Permanently — "this URL is gone for good; the new one replaces it." Search engines drop the old URL from the index over time and transfer its ranking signals to the destination.
302 Found (and its stricter twin, 307 Temporary Redirect) — "this URL is still the real one; send people over there for now." Search engines keep indexing and ranking the original URL and treat the destination as a temporary detour.
When to use which
Use a 301 when:
- You changed a URL structure (
/blog/post→/articles/post). - You moved to a new domain.
- You went from HTTP to HTTPS, or consolidated www and non-www.
- You merged two pages into one.
- You deleted a page and have a close replacement.
Use a 302 or 307 when:
- You're running an A/B test and will switch back.
- A page is down for maintenance for a few hours.
- You're redirecting by country or device and both versions are meant to stay live.
- A seasonal promotion temporarily replaces a permanent page.
If you're unsure, ask one question: will the old URL ever serve content again? No means 301.
What goes wrong
The common failure is using a 302 for a permanent move, usually because it's the default. Many frameworks, plugins and load balancers issue a 302 unless you explicitly say otherwise. RedirectMatch without a code in Apache, redirect in some Django and Rails helpers, and most CDN "forwarding" toggles all default to temporary.
The result: you migrate a site, everything looks fine to visitors, and months later the new URLs still aren't ranking. Google is still holding the old ones because you told it to.
The reverse mistake is rarer but worse in one case: using a 301 during a short test. Browsers cache 301s aggressively, sometimes indefinitely. If you 301 your homepage somewhere by accident and then undo it, visitors who saw the redirect may keep getting sent there until they clear their cache. For anything you might reverse, use a 302.
Check what you're actually sending
You can't tell from a browser; it follows the redirect and shows you the destination either way. You need to request the URL without following it and read the status code.
Paste any URL into the Redirect & Status Checker and you'll see each hop with its code: 301, 302, 307, 308, and the final status. It flags temporary redirects so you can spot a 302 that should have been a 301, and it takes up to 20 URLs at once, which is what you want after a migration.
How to fix a wrong 302
Apache (.htaccess) — add the code explicitly:
Redirect 301 /old-page https://example.com/new-page
# or with mod_rewrite
RewriteRule ^old-page$ /new-page [R=301,L]
Without 301 or R=301, Apache sends a 302.
Nginx — redirect is 302, permanent is 301:
# temporary (302)
rewrite ^/old-page$ /new-page redirect;
# permanent (301) ← use this for real moves
rewrite ^/old-page$ /new-page permanent;
WordPress — open your redirect plugin (Redirection, Rank Math, Yoast Premium) and check the type column on each rule. Most default to 301, but imported rules and some themes don't.
Cloudflare — Rules → Redirect Rules → each rule has a status-code dropdown. "Dynamic" redirects default to 302.
After changing it, re-run the URL through the checker to confirm, then use URL Inspection in Search Console on the old URL and request indexing so Google picks up the new signal faster.
What about 307 and 308?
- 307 is a stricter 302: temporary, and it guarantees the request method stays the same (a POST stays a POST). Harmless; treat it as a 302.
- 308 is a stricter 301: permanent, method preserved. Also fine. Some servers use it for HTTPS upgrades.
For ordinary page moves, 301 and 302 are all you need. Just make sure you're sending the one you mean.
Frequently asked questions
What is the difference between a 301 and a 302 redirect?
A 301 is a permanent move and transfers ranking signals to the new URL. A 302 is temporary and keeps the original URL indexed and ranking.
Does a 302 redirect hurt SEO?
Only when it is used for a permanent move. Google then keeps the old URL in its index, so the new page never inherits the old one's authority.
Can I change a 302 to a 301 later?
Yes. Change it at the server or in your redirect plugin, then request re-indexing of the old URL in Search Console.
How do I check which redirect my site sends?
Request the URL without following redirects and read the status code. A redirect checker does this for you and shows every hop in the chain.
Try it on your site
Free, no signup. Takes about ten seconds.