This guide answers: 301 or 302 redirect: which one to use and why
301 or 302 redirect: which one to use and why
Use a 301 for a permanent move and a 302 for a temporary one. Learn what each code tells browsers and search engines, and how to choose the right one.
By Hannah Wells, Technical SEO, site performance and online stores
· 7 min read
updated

Short answer
Use a 301 when the move is permanent and the old URL is never coming back. Use a 302 when the move is temporary and you plan to reverse it. Both codes send visitors to a new address, but they tell browsers and search engines different things about what happens next.
Key points
- Before looking at the gap, it helps to see how much the two codes share.
- A 301, "Moved Permanently", tells browsers and search engines that a URL has a new, permanent home.
- Browsers read the two codes differently. According to RedirHub, with a 301 redirect browsers may remember it, which can cause problems if you later change your mind.
- On the search side, RedirHub describes Google's handling this way.
What these two redirects have in common
Before looking at the gap, it helps to see how much the two codes share. Both are HTTP redirects from the 3xx family. Both take a visitor who asks for one URL and deliver them to another. Both work on the server side, so the visitor usually notices nothing beyond a page that loads. And both can be put in place at any time, on a single page or across a whole site.
That overlap explains why the choice feels minor. A visitor who clicks a link lands on the right page whichever code you pick. The difference lies in the message each code sends: to browsers, to search engines, and to whoever maintains the site later.
Other 3xx codes exist, including 307 and 308. They are a separate topic and are not covered here. This page stays on the classic pair.
Permanent vs temporary: the core difference
A 301, “Moved Permanently”, tells browsers and search engines that a URL has a new, permanent home. The old address is retired. A 302 indicates a temporary relocation. The old address may come back, so the redirect is a detour, not a move.
This is a statement of intent. The code does not change how the page looks. It tells every system that reads it how to treat the old URL from now on: forget it, or keep it in mind.
The practical question is therefore simple: is this change meant to last? If you are sure the old URL will never return, say so with a 301. If you might undo the change next week or next month, say so with a 302. Everything else on this page follows from that single question.
Browser caching behavior
Browsers read the two codes differently. According to RedirHub, with a 301 redirect browsers may remember it, which can cause problems if you later change your mind. A visitor who has already followed the redirect may keep being sent to the new address, even after you have removed or changed the rule on your side.
A 302 works the other way. It requires explicit cache headers, which makes it easier to modify without long-term consequences. If you point a URL somewhere for a short period and then restore it, returning visitors are far less likely to remain stuck on the detour.
What this means for visitors
The cache matters most when you change your mind. With a 301, a reversal may reach some returning visitors late, because their browsers still hold the earlier instruction. With a 302, going back is smoother and mostly invisible to them.
This is the first real argument for choosing carefully. A 301 is not a problem when the move is truly final. It becomes one when it is used for something that was never meant to be final.
How search engines treat each code
On the search side, RedirHub describes Google’s handling this way. A 301 is treated as a canonical signal, consolidating ranking authority to the new URL. A 302 functions differently: Google follows the redirect but does not use it as a canonical signal, so the old URL usually stays indexed.
In practice, with a 301 the old page tends to drop out of the results and the new one takes its place. With a 302 the old page can remain visible, because the engine reads the redirect as a detour and keeps the original address as the one that matters.
The risk of forgetting a temporary redirect
A temporary redirect left in place for a long time creates ambiguity. Leaving a 302 redirect in place for months can eventually cause Google to treat it like a permanent change anyway. How long that takes is unpredictable, and no reliable delay can be given.
The consequence is that you lose control. You chose a temporary code, but the engine may end up behaving as if you had chosen a permanent one. If the redirect is meant to last, it is cleaner to say so from the start.
Link equity and PageRank transfer
A common belief says only a 301 passes PageRank. That is the part of the debate that has aged worst. Since 2016, Google has been reported to confirm that any 3xx redirect, including a 301 or a 302, passes full PageRank. This comes from secondary reporting, so check the current Google Search Central documentation before quoting it as an official rule.
If both codes pass link value, the real difference is how the engine handles the pages. A 301 is read as a canonical signal. A 302 is not. What changes is the treatment of the old and new URLs, not an amount of value lost on the way.
The practical lesson is to choose on permanence, not on fear of losing PageRank. Picking a 301 for a short test, or avoiding a 302 for a real test because of an outdated myth, both rest on the wrong reasoning.
Side by side: the comparison table
| Criterion | Code 301 | Code 302 |
|---|---|---|
| Semantic signal | Moved Permanently | Temporary relocation |
| Indexing status | Treated as a canonical signal, authority consolidated to the new URL | Followed, but not a canonical signal; the old URL usually stays indexed |
| Browser cache | May be remembered by browsers | Requires explicit cache headers |
| Primary use case | Migrations, permanent URL changes, consolidations | Maintenance, short campaigns, tests, temporary stock issues |
| Reversibility | Harder, because cached visitors may keep the old instruction | Easier, with no long-term consequences |
| Risk if forgotten | Fine if the move is final; a problem if you later change your mind | Google may eventually treat it as permanent anyway |
Use a 301 if
- You are moving to a new domain for good.
- You delete a page and replace it with another.
- You are restructuring your URLs permanently.
- You are certain the old URL will never come back.
RedirHub sums it up this way: use a 301 for domain migrations, permanent URL structure changes and site consolidations.
Use a 302 if
- You are testing a new version of a page, such as an A/B or multivariate test.
- A temporary maintenance period is under way.
- You want to try a new URL structure before validating it.
- A short-term campaign is running, or a product is temporarily out of stock.
- You know the change is temporary and reversible.
The same source recommends a 302 for maintenance periods, short-term campaigns and products that are temporarily out of stock. On tests, the reported position is that Google specifically recommends a 302 rather than a 301 for tests that redirect users to an alternative URL. Confirm the wording in Google Search Central before treating it as an official rule.
The decision: a verdict by use
There is no absolute winner. Each code does a different job, and the right choice depends on what you are doing. Neither is outdated, and neither is always better.
A simple question tree
- Is the change permanent? Use a 301.
- Is it a test, a maintenance window or a short campaign? Use a 302.
- Will you want to reverse it easily? Lean toward a 302.
- Are you sure the old URL is gone for good? Lean toward a 301.
Verdict by profile
- Site owner changing domain: a 301 fits, since the move is final and you want authority consolidated on the new address.
- Owner of a small site restructuring URLs: a 301 fits once the new structure is settled. If you are still trying it out, a 302 keeps your options open.
- Marketer running a short campaign: a 302 fits, because the destination is temporary and the original page should stay in place.
- Team testing page variants: a 302 fits, in line with the reported Google recommendation for tests.
- Anyone unsure: a 301 is generally safer over the long run, but remember the browser caching risk if you might reverse the decision.
One rule holds for everyone: never leave a 302 in place by oversight. A forgotten temporary redirect leaves the engine guessing what you meant, and the guess may not match your plans.
The Monday Crawl
What changed in the official documentation this week, in one email.
Next result



