301 vs 302 Redirects: Which to Use, and What Breaks
What actually differs between a 301 and a 302, why frameworks hand you the wrong one by default, and how to find and flatten the chains that build up behind them.

Like it ? share it
To a visitor a redirect is a redirect: they ask for one URL and land on another. To a search engine, a 301 says the move is permanent and a 302 says it is not, and that difference decides which of the two URLs stays in the index.
What each one means
301, moved permanently. Drop the old URL, the new one replaces it. Use it when you delete a page and send it somewhere relevant, when you move from HTTP to HTTPS, and when you merge two sites.
302, found — or 307, its stricter modern equivalent. The old URL is still the real one and will be back. Use it while you are A/B testing, while a temporary sale page is up, or during maintenance.
Google has said for years that a 301 passes full link equity, and that 302s pass it too. So the old fear about leaking authority per redirect is mostly settled.
The difference that still bites is canonicalisation: with a 302 you are telling Google the old URL is the one to keep indexed. On a permanent migration that is the opposite of what you want, and the symptom is a new site that will not rank while the old URLs linger in the index.
Why this happens by accident
Most web frameworks return 302 from a bare redirect() call. It is the safer default for a framework, because a wrongly-cached permanent redirect is very hard to undo in a browser. It is the wrong default for a migration.
If a developer moves a thousand URLs with the framework default and nobody checks the status codes, every one of those redirects is telling Google to keep the old page. Nothing errors. Nothing looks broken in a browser. The traffic just does not arrive at the new URLs.
Checking them
You cannot see a status code in the address bar — the browser follows the redirect faster than you can read it, and shows you only the destination. The Redirect Detector lists each hop with its code, so a 302 sitting in the middle of what should be a permanent move is visible. Paste the old URL, look at the codes, and if a permanent migration shows anything other than a single 301 you have found a bug.
Status codes worth recognising
| Code | Meaning | What it means for you |
|---|---|---|
| 200 | OK | The page loaded. Nothing to do |
| 301 | Moved permanently | Correct for any permanent change. Avoid chaining them |
| 302 | Found, temporary | The old URL stays canonical. Check it was deliberate |
| 304 | Not modified | The crawler's copy is current. Good for crawl budget |
| 307 | Temporary redirect | The modern 302. Same caution applies |
| 308 | Permanent redirect | The modern 301, and it preserves the request method |
| 401 | Unauthorized | Content behind a login. Fine if private, a bug if public |
| 403 | Forbidden | The crawler was refused. Usually a firewall rule |
| 404 | Not found | A dead end. Fix the link or redirect somewhere relevant |
| 410 | Gone | Deliberately deleted. De-indexes faster than a 404 |
| 429 | Too many requests | You are rate-limiting the crawler |
| 500 | Server error | The page is crashing. Check your logs first |
| 502 | Bad gateway | The front end cannot reach the back end |
| 503 | Service unavailable | Maintenance. Send a Retry-After header with it |
| 504 | Gateway timeout | Something upstream is too slow to answer |
Chains: the other way redirects go wrong
Getting the code right is half of it. The other half is how many of them run before the reader arrives. Page A redirects to B, B redirects to C, C redirects to D, and nobody notices because the browser still ends up somewhere sensible.
What a chain costs
Every hop is a round trip. Each redirect is a full request and response before the next one starts. On a fast connection that is barely visible. On a slow mobile connection, three hops in front of a page is a real delay stacked on top of the page's own load time.
A chain has more places to break. Since a 301 passes full equity, the risk is structural rather than arithmetic: if any link in the chain later returns a 404 or a 500, the whole path from the original backlink dies. The further the chain runs, the more chances there are for that to happen.
Crawlers spend budget on it. Following redirects is work a crawler does instead of fetching new pages. On a large site with a lot of legacy paths, that adds up.
What a chain looks like
A typical one is built out of three reasonable decisions made years apart:
http://yoursite.com/old-page 301 → the HTTP to HTTPS rule
https://yoursite.com/old-page 301 → the restructure
https://yoursite.com/new-category/old-page 301 → the rename
https://yoursite.com/new-category/final-page 200
Three hops where there should be one. No single rule is wrong. The combination is.
Flattening it
The fix is always to make the first redirect point at the final destination. In the chain above, rewrite the first rule so /old-page goes straight to /new-category/final-page. Leave the intermediate rules in place — something may still link to those URLs directly — but make each of them point at the end too, rather than at the next step.
The trailing-slash chain
The most common accidental chain comes from handling two normalisations as two separate rules:
http://site.com/page → https://site.com/page → https://site.com/page/
Protocol and trailing slash, one hop each. Both belong in a single rewrite rule in your server config, so the first request lands on the canonical form directly.
Where to look first
Not everywhere. Chains only matter where traffic actually arrives, so start with the pages that have the most external links pointing at them and check those. A three-hop chain on a URL nobody links to is not costing you anything worth an afternoon.
Two mistakes worth naming
Redirecting everything to the homepage. When a product or article is deleted, sending it to / is the fast fix. Google treats it as a soft 404, because the homepage is not a replacement for a specific page, and the keywords the old page ranked for go nowhere. Redirect to the nearest real equivalent instead. If there genuinely isn't one, a 410 is better than a redirect that lies.
Letting chains accumulate. A redirect that points at another redirect adds a round trip and another thing that can break later. Point the first one at the final destination.