301 vs 302 redirects: which one to use
Use a 301 when a page has moved for good, so the new URL takes its place in search. Use a 302 when the move is temporary and the original URL should stay in search. If you're not planning to change it back, use a 301.
The difference
Both send visitors to another URL, and visitors won't notice which you used. The difference is what you're telling search engines about which URL to keep.
| 301 | 302 | |
|---|---|---|
| Means | Moved permanently | Found, usually temporary |
| Signal to Google | The new URL should be canonical | Keep showing the original URL |
| What shows in search | The new URL | Usually the original URL |
A redirect is one signal among several. Google says a temporary redirect can still end up with the target indexed if other signals point to it, and the old URL can keep appearing for a while after a permanent move.
All the redirect types
| Type | How Google treats it | Note |
|---|---|---|
301 | Permanent | The usual choice for moved pages |
308 | Permanent | Keeps the request method, such as POST |
302 | Temporary | The usual choice for short-term moves |
303 | Temporary | Often used after a form submission |
307 | Temporary | Keeps the request method |
| Meta refresh, 0 seconds | Permanent | Use only if you can't redirect on the server |
| Meta refresh, delayed | Temporary | Confusing for visitors too |
| JavaScript | Permanent | A last resort, as Google may not see it if rendering fails |
From Google's redirects documentation. It prefers server-side redirects because they're the most reliably understood.
Which one to use
| Situation | Use |
|---|---|
| A page has a new URL | 301 |
| Moving from HTTP to HTTPS, or to a new domain | 301 |
| Merging two pages into one | 301 to the page that stays |
| Short maintenance or a brief campaign swap | 302 |
| An A/B test that sends some visitors to another URL | 302 |
| A page removed with no replacement | No redirect. Return 404 or 410 |
The common mistake is a 302 left in place for months after a permanent change. It's often a platform default or a quick fix that nobody revisited. If the old URL stays in search after a move, check this first.
Don't send removed pages to the homepage either. Google can treat that as a soft 404, and it's no help to the visitor. Redirect to a close replacement or let the page return a 404.
How to check a redirect
1Use curl 30 seconds
This shows the status and destination of every hop:
curl -sIL https://example.com/old-page | grep -iE '^(HTTP|location)'
2Use the browser 1 minute
Open DevTools (F12), go to the Network tab, tick Preserve log and load the old URL. The first request shows its status code and Location header.
While you're there, count the hops. Google follows up to 10, but it advises redirecting straight to the final URL. If you can't, it suggests no more than 3 and always fewer than 5. Point your internal links at the final URL too. If the hops never end, see how to fix a redirect loop.
How to set one up
Keep permanent redirects for at least a year, which is Google's general advice for a site move. Longer is fine.
- Apache:
Redirect 301 /old-page /new-page - Nginx:
location = /old-page { return 301 /new-page; } - Next.js: add it to
redirects()innext.config.js.permanent: truesends a 308 andfalsesends a 307, not 301 and 302. Google treats them the same way. - Shopify: go to Content > Menus, then View URL Redirects. It only redirects URLs that are already broken, so a page that still loads won't redirect.
- WordPress: use a redirect plugin or set it at server level. Check which status it sends, as the default may not be what you want.
Checking a page's links?
Find redirects from any page
Open SEOSnip on a page and run the link checker. It checks up to 100 of the page's links, plus its canonical and hreflang targets:
- Internal links that redirect, with the final URL to link to instead
- Canonical and hreflang targets that redirect
- Meta refresh redirects, with their delay
- A ticket with that evidence, and Check if fixed to run it again
It shows where a link ends up, not each hop, so use curl to count a chain.