Use a 301 when the page has moved for good. Use a 302 when the move is temporary and the old address will be used again.1 That's the whole rule. The rest of this page is why it matters.
What each one says
A 301 tells browsers and search engines the page now lives somewhere else for good.2 A 302 says it's only been moved for the time being.3
Visitors can't tell the difference. Google says users generally won't notice which type you used.1 The browser loads the new page either way.
Why search engines care
Search engines read the code as a hint about which address to show in results.
| Permanent | Temporary | |
|---|---|---|
| Meaning | Moved for good2 | Moved for now3 |
| Which address Google shows | The new one1 | The old one1 |
| How Google treats the signal | A strong signal that the target should be processed4 | A weak signal that the target should be processed4 |
Google puts it like this: use a permanent redirect when you're sure it won't be reverted.1
When a 301 fits
- You renamed a page or changed its address.
- You merged two pages into one and want old links to land on the merged page.
- You changed domain names and want the old addresses to carry on working.
In each case the old address isn't coming back. So say so. What to do when you change a page address has the full steps.
When a 302 fits
Use it when the old address stays the real one. Google's example is a service that's temporarily unavailable. You can send people to a page explaining what's happening, without changing which address appears in search results.1
Other cases are a short sale page or a maintenance notice. Switch the redirect off when it's over.
The mistake that catches people
You set up a redirect and it's temporary when you wanted permanent. That's the usual slip. It's easy to miss because the page still loads.
On Apache servers it's built in. MDN notes that the Redirect and RedirectMatch directives set up 302 redirects by default.5 To get a permanent one, you add an extra parameter, either the status code or the permanent keyword.5
If you use a plugin or your host's dashboard, look for a setting that says "permanent". Follow your host's own guide, because the steps differ from one platform to the next.
What about 307 and 308?
They exist too. Google treats 307 as the same as a 302, and 308 as the same as a 301.4 For ordinary page moves, 301 and 302 are what you'll usually meet.
After you set one up
Open the old address in a browser. You should land on the new page, not an error and not another redirect. If you're not sure which code your redirect uses, check your tool's settings page or ask your host.
Where the facts come from
- Redirects and Google Search, Google for Developers
- 301 Moved Permanently - HTTP, MDN Web Docs
- 302 Found - HTTP, MDN Web Docs
- How HTTP status codes affect Google's crawlers, Google for Developers
- Redirections in HTTP, MDN Web Docs