A 301 redirect says a page has moved permanently, and a 302 redirect says the move is temporary. Use 301 when the old address will not come back, such as after a URL change or site move. Use 302 when the original address will return, for example during a short test or maintenance period.
Why it matters
Search engines use the type of redirect as a signal about which URL to keep in their index. Google's documentation describes a permanent redirect as a strong signal that the target should be the canonical URL and a temporary redirect as a weaker one. Choosing the wrong type can leave the old address in search results longer than you want, or drop an address you meant to keep.
How to decide and check
- Ask whether the old URL will ever serve its own content again. If not, use 301. If yes, use 302.
- Common 301 cases: moving to HTTPS, choosing www or non-www, renaming a page, merging pages and moving to a new domain.
- Common 302 cases: sending visitors to a language or region page for a limited time, an A/B test, a short sale landing page or a maintenance notice.
- Check what you are sending today:
curl -sI http://example.com/old-page
The first line shows the code, for example HTTP/1.1 301 Moved Permanently or HTTP/1.1 302 Found.
5. Look at the CMS or server setting that created the redirect. Many plugins default to 302 unless you change it, and some frameworks use 302 for their ordinary redirect helper.
6. If you find a long-lived 302 that should be permanent, switch it to 301 and test again.
7. Know the sibling codes. 307 is a temporary redirect and 308 is a permanent one, and both keep the original request method, such as POST, unchanged.
Common mistakes
- Leaving a 302 in place for months after a permanent move.
- Using a 301 for something temporary and then struggling to bring the old URL back, because browsers may remember a 301 for a long time.
- Assuming a 302 never works. Google does follow it, but the permanent code states your intent more clearly, so do not rely on a temporary redirect to behave like a permanent one.
- Using a JavaScript or meta refresh redirect where a server redirect is possible.
- Mixing both types in a redirect chain.
Frequently asked questions
Does a 302 pass link value?
Google follows 302 redirects and, per its documentation, treats them as a weaker hint that the original URL stays canonical. Use the correct code for your intent instead of trying to predict how signals flow.
Which is better for SEO?
Neither is better in general. Use 301 for permanent changes and 302 for temporary ones, because matching the code to your intent gives search engines the clearest signal.
Can browsers cache these redirects?
Yes. Browsers can cache a 301 for a long time, so test carefully before making one permanent. A 302 is normally not cached unless the response says to cache it.
Related guides
- 301 vs 302 redirects for SEO
- Nginx and Apache redirects for SEO
- Redirect chains and loops
- Page with redirect in Search Console
To see which status codes your own pages return, Try the free website sample.