How-to guide

301 vs 302 redirects: which to use and how to check them

Permanent or temporary, what each one does to search rankings, and how to find chains and loops.

Web developers, SEO and marketing teams4 min readUpdated
Short answer

Use a 301 (or 308) when a page has moved for good: search engines move its ranking to the new URL. Use a 302 (or 307) only for a short-term detour, when the old URL should keep its place. 307 and 308 keep the request method, so a form POST stays a POST. Aim for a single hop from the old URL to the final page.

The four redirect codes

  • 301 Moved Permanently: the page has a new home. Browsers may cache it; search engines transfer ranking.
  • 302 Found: a temporary detour. Search engines usually keep the original URL indexed.
  • 307 Temporary Redirect: like 302, but the browser must repeat the same method and body.
  • 308 Permanent Redirect: like 301, but keeps the method. Useful for APIs and form endpoints.

Which one to use

  • Moving a site to a new domain, merging pages, switching to HTTPS or choosing www or non-www: 301.
  • A maintenance page, an A/B test or a short promotion: 302.
  • An API or form endpoint that moved: 308 (permanent) or 307 (temporary).
  • Not sure? If you’d be happy for the old URL to vanish from search results, it’s a 301.

Common mistakes a redirect check finds

  • Chains: http → https → www → final page is three hops where one would do.
  • Loops: two URLs that send to each other, which browsers stop with an error.
  • Temporary codes on a permanent move, which can leave the old URL in search results for months.
  • Redirecting every old page to the home page. Search engines treat that as a missing page; map each old URL to its closest new one.
Tip: After any migration, check a sample of old URLs, including ones with query strings and trailing slashes.

Questions people ask

Does a 301 redirect lose SEO value?
Google has said 301, 302 and 308 redirects don’t lose PageRank. What matters is that the redirect is permanent when the move is, and that it lands on a relevant page.
How long should I keep a 301 redirect?
At least a year, and ideally for good while old links still point to the address.
How do I check if a URL redirects?
Paste it into a redirect checker. It follows every hop and shows each status code, the address it went to and how long it took.
Is a meta refresh or JavaScript redirect the same?
No. They run after the page loads, are slower and are less reliably followed by crawlers. Use a server-side 301 where you can.

Sources and further reading

Written by the middle.network team, who build and run these tools. Last checked 2026-11-21.