301 vs 302 redirects: which should you use?
What the two status codes actually mean, how browsers and search engines cache them, and why using a 302 for a permanent move quietly costs you.
Both codes do the same visible thing: a visitor asks for one address and the browser sends them to another. The difference is what you are claiming about permanence — and caching, search indexing and how easily you can change your mind all follow from that claim.
What the two codes mean
| 301 Moved Permanently | 302 Found | |
|---|---|---|
| The claim | This address has been replaced. Use the new one from now on. | This is temporarily somewhere else. Keep asking for this address. |
| Browser caching | Cached hard, often for months | Not cached — asked again every time |
| Search engines | Destination replaces the source in the index | Source stays indexed |
| Easy to undo | No | Yes |
Mechanically they are identical — a status line and a Location header that the browser follows.
Only the promise differs. Everything below is a consequence of software believing that promise.
What browsers do with each
A 301 is cacheable by default, and browsers cache it aggressively. Once a visitor has followed your 301, their browser may stop asking your server about that address at all — it goes straight to the destination, sometimes for months, sometimes until they clear their cache.
A 302 is not cached by default. The browser asks again every time, which is exactly what “temporary” implies.
What search engines do with each
A 301 is a strong signal that the destination is now the canonical address. Over time the destination replaces the source in the index, and the ranking signals the old address had accumulated are consolidated onto the new one.
A 302 says the opposite: keep the original indexed, because it is coming back. Search engines generally do exactly that.
When a 301 is right
- You have moved to a new domain and the old one is not coming back.
- You retired a brand or company name and want its traffic to land on the current site permanently.
- You bought the misspelling, the hyphenated version or the
.netof your domain, and it should always point at the real one. - You merged two sites and one of them is now the survivor.
When a 302 is right
- A campaign or seasonal page that will point somewhere else next quarter.
- Maintenance: sending visitors to a status page while the real one is down.
- You are testing a destination and are not yet sure it is final.
- The original address is genuinely coming back.
The mistake people actually make
Using a 302 for a permanent move. It happens constantly, usually because 302 is some tool’s default, or because it feels like the cautious option.
The cost is quiet. Search engines keep the old address in the index, keep treating it as the canonical one, and do not consolidate its accumulated signals onto the new site. Months later the old domain is still what people find, and the new one looks like it never inherited anything — because as far as any crawler was told, nothing was ever handed over.
The mirror image is the other mistake: publishing a 301 before you are certain of the destination, then discovering that returning visitors are pinned to a URL you have abandoned.
Where you choose in HTTPSredirect
On the last step of adding a domain — the one headed Set your redirect — the Redirect type field offers Permanent (301) and Temporary (302). It can be changed later from the domain’s redirect settings. New visitors get whatever is set at the time; anyone whose browser already cached a 301 will keep following the old one until that cache expires.
On Plus and Pro, advanced URL redirects carry their own redirect type per rule, so a single domain can serve a permanent move for most of its addresses and a temporary one for a campaign path.
If you have not set the domain up yet, the walkthrough starts here.
Checking which one you are serving
Browsers hide redirects by design, so the address bar will not tell you which code you sent. The quickest way to find out is to paste the domain into a redirect tracer:
Tools we recommend
- Where Goes? (opens in a new tab) Paste your domain and it traces the whole redirect chain — every hop, with the status code for each. The easiest way to see whether you are serving a 301 or a 302, and to catch an accidental extra hop.
Your browser’s own developer tools show the same thing:
-
Open the Network tab
Press F12 (or ⌥⌘I on a Mac) and switch to Network. Tick Preserve log, so the redirect is not wiped away when the destination loads.
-
Visit your domain
The redirect appears as its own entry above the request for the destination, with 301 or 302 in the status column.
If you are comfortable with a terminal Optional — the Network tab shows the same thing
curl -sI https://example.com
The first line is the status — HTTP/2 301 or HTTP/2 302 — and
location: is where it points. Add -L to follow the whole chain, which is how you
find the accidental extra hop that a lot of setups have picked up over the years.
Ready to set this up?
The free plan covers one domain, certificate included. No credit card required.