Troubleshooting
301 vs 302 redirects (and 307, 308): which to use for SEO
301 and 308 redirects are permanent; 302 and 307 are temporary. How Google treats each, when method preservation matters, and how to check a URL's redirect.
Updated · 5 min read
301 vs 302: the short answer
A 301 redirect says a page has moved permanently, while a 302 says the move is temporary and the original URL should be kept. For SEO, Google treats 301 (and 308) as a strong signal that the new URL should be shown in search results, and 302 (and 307) as a weak signal, so the original URL is more likely to stay indexed.
Use a permanent redirect when the old address is gone for good: a site move, a switch to HTTPS, a merged or renamed page. Use a temporary redirect when the original address will come back.
The four redirect codes
HTTP defines four main redirect codes, which differ on two questions: is the move permanent, and must the browser keep the same request method?
- 301 Moved Permanently: permanent. Browsers have historically changed POST requests to GET when following it, which the HTTP specification now allows for compatibility.
- 302 Found: temporary. Same method caveat as 301: a POST may be retried as GET.
- 307 Temporary Redirect: temporary, and the method and body must be preserved, so a POST stays a POST.
- 308 Permanent Redirect: permanent, with the method and body preserved.
- 303 See Other is a related code that always switches to GET, typically used to send a browser to a result page after a form submission.
How Google treats each one
Google's documentation on redirects groups them by permanence. For 301 and 308, Google uses the redirect as a strong signal that the target should be canonical, the URL shown in search. For 302 and 307, Googlebot follows the redirect, but treats it only as a weak signal, so the original URL may stay in the index. Google's crawlers follow up to 10 redirect hops.
Choosing the wrong code is not a catastrophe, because Google follows both kinds and weighs other canonical signals such as internal links and sitemaps. Google representatives have said that redirects do not lose PageRank. But the code is the clearest instruction you can give, so match it to your intent.
Other redirect methods carry less certainty. Google treats an instant meta refresh as permanent and a delayed one as temporary. JavaScript redirects only work if Google renders the page, and Google's documentation advises using them only when server-side and meta refresh redirects are not possible.
Browser caching: why 301s are hard to undo
Permanent redirects are cacheable by default. Browsers can remember a 301 or 308 and skip the request to the old URL entirely, sometimes for a long time. If you set a 301 by mistake and then remove it, visitors who already followed it may keep being redirected until their browser cache is cleared.
A 302 or 307 is not cached unless the response explicitly says so. When testing a new redirect rule, start with a temporary redirect, confirm it behaves correctly, then switch it to permanent.
Chrome's developer tools sometimes show a 307 Internal Redirect that the server never sent. It comes from the browser enforcing HSTS, upgrading http:// to https:// on its own, and is labelled with a Non-Authoritative-Reason: HSTS header.
Which redirect to use when
Match the code to the situation:
- Moving to a new domain: 301 or 308, page to page, not everything to the home page.
- Switching from HTTP to HTTPS, or picking www or non-www: 301 or 308.
- Renamed, merged or reorganised URLs: 301 or 308 from each old URL to its closest equivalent.
- A page temporarily unavailable, a short-term campaign URL, or A/B testing: 302 or 307.
- Redirects that must keep a POST request intact, such as API endpoints or form handlers that moved: 307 for temporary, 308 for permanent.
- Sending visitors to a language or regional version: usually 302, so the original URL stays canonical for search.
Setting the right code on common platforms
Many tools default to a temporary redirect when no code is specified, so it pays to be explicit:
- Apache: Redirect 301 /old-page https://example.com/new-page in .htaccess. A Redirect without a status, or a RewriteRule with the R flag but no number, sends a 302.
- Apache with mod_rewrite: add R=301 or R=308 to the RewriteRule flags, usually together with L.
- nginx: return 301 https://example.com$request_uri; for whole-site redirects. A rewrite rule with the permanent flag sends 301, and with the redirect flag sends 302.
- WordPress: redirect plugins let you choose the code per rule. Check the default before adding many rules.
- Cloudflare: redirect rules let you choose between 301, 302, 307 and 308 for each rule.
How to check which redirect a URL uses
The redirect checker follows a URL hop by hop and shows each status code, the Location target and the time each hop took. It also detects loops and checks that HTTP goes to HTTPS and www handling is consistent.
In a terminal, curl -I https://example.com/old-page shows the first response's status and Location header; adding -L follows the whole chain. In browser developer tools, enable "Preserve log" on the Network tab before loading the URL, so the redirect responses are not cleared when the page changes.
Check every variant that visitors and links might use: http and https, www and non-www, and paths with and without a trailing slash. Each should reach the final URL in a single hop with the status code you intended.
Common redirect mistakes
Most redirect problems come from a handful of habits:
- Chains. http://example.com to https://example.com to https://www.example.com to the final page adds a round trip per hop. Point every old URL straight at its final destination.
- Redirecting everything to the home page. Google may treat irrelevant redirects to the home page as soft 404s, so the old page's signals are not passed on.
- Temporary redirects for permanent moves, often because a plugin or control panel defaults to 302. Check the actual status code after setting a redirect.
- Removing redirects too soon. For site moves, Google's documentation recommends keeping redirects in place for as long as possible, generally at least a year.
- Loops, where two rules redirect to each other, which leave visitors with ERR_TOO_MANY_REDIRECTS.
Common questions
- Is a 301 or 302 redirect better for SEO?
- Use 301 for permanent moves, so Google treats the new URL as canonical. Use 302 only when the original URL is coming back. Neither is better in general; the right one depends on whether the move is permanent.
- What is the difference between 302 and 307?
- Both are temporary. A 307 requires the browser to repeat the request with the same method and body, while a 302 allows a POST to be changed to GET. Google treats them the same.
- What is the difference between 301 and 308?
- Both are permanent. A 308 preserves the request method and body, so a POST stays a POST. For search engines they are equivalent.
- Do redirects lose link equity?
- Google has said 3xx redirects do not lose PageRank. Chains and redirects to unrelated pages, such as the home page, can still weaken how signals pass.
- How to check if a redirect is 301 or 302?
- Use a redirect checker, run curl -I on the URL, or watch the Network tab in browser developer tools with Preserve log enabled. Each shows the status code of every hop.
Redirect checker
Trace every hop of a redirect chain — status codes, timing, loops and HTTPS issues.
Check your redirectsRelated guides
- ERR_TOO_MANY_REDIRECTS: how to fix a redirect loopERR_TOO_MANY_REDIRECTS means a redirect loop. Fixes for WordPress URL settings, Cloudflare Flexible SSL, www conflicts and plugins, and how to trace the loop.
- How to fix a slow TTFB: server-side fixes that actually workSlow Time to First Byte is a server or network problem, not a page problem. Find the slow phase, then fix it with caching, a CDN, database work or hosting.
- How to check DNS propagation (and why it takes so long)Check DNS propagation by comparing public resolvers with your authoritative nameservers. Learn how TTL sets the timing and why changes seem stuck for hours.
- Why is my website down? How to find the cause, step by stepFind out why your website is down: check if it's down for everyone, decode the error, and test the domain, DNS, SSL and server in the order that saves time.