zaDojo

301 vs 302 redirects: which to use for SEO

A 301 says a page moved for good, a 302 says it moved for now. When to use each, how redirects pass rankings, and how to find chains and loops before they cost you traffic.

By Denis Veisllari

Use a 301 when a page has moved permanently and the old URL should never come back. Use a 302 when the move is temporary and you want the old URL to keep its place in search.

Google says both pass ranking signals, so picking the wrong one rarely sinks a page. What it changes is which URL Google keeps showing. A 302 left in place for months tells Google to keep the old URL indexed, which is usually not what you meant.

The redirect codes you will meet

CodeMeaningUse it when
301Moved permanentlyA URL changed for good: new slug, merged pages, new domain
308Permanent, keeps the methodSame as 301 for SEO; common on modern hosting and frameworks
302Found (temporary)A short campaign, a test, a page that will come back
307Temporary, keeps the methodSame as 302 for SEO; also used for HTTP to HTTPS in browsers

For SEO purposes, 308 behaves like 301 and 307 behaves like 302. Many hosts and frameworks send 308 and 307 by default, and that is fine.

A meta refresh or a JavaScript redirect also moves people, but crawlers handle them less reliably. Use a server-side redirect whenever you can.

When to use a 301

  • You renamed a page's URL.
  • You merged two pages that competed for the same searches. Keep the stronger one and redirect the other to it.
  • You moved from http to https, or from www to the bare domain (or the other way round).
  • You moved to a new domain.
  • You deleted a product or article and there is a close replacement. Redirect to the replacement, not to the home page.

If there is no close replacement, let the URL return a 404 or 410. Redirecting hundreds of dead pages to the home page is treated as a soft 404 anyway and confuses visitors.

When to use a 302

  • A product is out of stock for a week and you send people to a category page meanwhile.
  • You are running a seasonal landing page and the normal page comes back after.
  • You are A/B testing two versions of a page on different URLs.

If a "temporary" redirect is still there after a few months, it is permanent. Change it to a 301.

Chains and loops

A redirect chain is A to B to C. Each hop adds a delay for visitors, and crawlers stop following after a number of hops. Chains build up quietly: you move a page once, then again a year later, and the first redirect now points at a redirect.

A redirect loop is A to B to A. Nobody reaches anything, and the browser shows an error.

Fix both the same way: point every old URL straight at the final destination in one hop.

A redirect checklist for a site change

  1. List every old URL. Export them from your sitemap, your analytics or a crawl before you change anything.
  2. Map each one to its new URL. One row per old URL. Do not rely on a pattern rule you have not tested.
  3. Use 301s (or 308s) for everything permanent.
  4. Update internal links to point at the new URLs directly, so your own site does not run through redirects.
  5. Update the sitemap to list only final URLs.
  6. Crawl the site after launch and look for chains, loops and 404s.
  7. Watch Search Console for a few weeks. Old URLs should drop out and new ones take their place.

How to check your redirects

  • For one URL: open your browser's developer tools, go to the Network tab, load the old URL and look at the status code of the first request.
  • From the command line: curl -I https://example.com/old-page prints the status code and the Location header the redirect points to.
  • For a whole site: run a crawl. zaDojo's site audit follows links across your site and flags redirect chains and loops alongside broken links and other technical issues. Plain audits are free with an account.

On Shopify, redirects work through the admin's URL redirects screen. Our Shopify redirects guide walks through it.

Questions people ask

Does a 301 lose ranking power?

Google has said for years that 301 and 302 redirects do not lose PageRank. In practice a redirect to a relevant page keeps its rankings, and a redirect to an unrelated page does not, because the new page no longer answers the search.

How long should I keep a 301 in place?

Google recommends at least a year. Keeping it longer costs nothing, and links on other sites may keep sending visitors to the old URL for much longer than that.

Is a 302 bad for SEO?

No, when the move really is temporary. It only causes trouble when it is used for a permanent move and left in place, because Google keeps the old URL in its index.