Skip to main content
Guide 6 min read

301 vs 302 Redirects: Which to Use and What Each Does to SEO

You moved a page, changed a domain or fixed a messy URL. Now you need a redirect, and your server asks you to pick a number. The 301 vs 302 redirects choice looks tiny. It isn’t. Pick the wrong one and Google can keep showing your old URL for months, or you can lock a browser into a redirect you meant to remove.

This guide explains what each code does, what it means for SEO, when to use each one and how to set them up safely. You’ll also get a checklist for site moves, because that’s where most redirect mistakes happen.

What a redirect actually does

A redirect tells a browser or a search engine bot, “The page you asked for lives somewhere else. Go here instead.” The server sends a short answer with a status code and a new address, and the client follows it.

The code matters because it says why the page moved. Permanent means the old address is retired. Temporary means the old address will return. Browsers and search engines treat those two stories very differently.

301 redirects: the permanent move

A 301 means Moved Permanently. You’re telling the world, “Forget the old URL. This is the new home.”

Search engines respond by swapping the old URL for the new one in their index over time. Browsers respond by remembering the redirect. They cache a 301 so firmly that visitors can keep landing on the new page even after you remove the rule on the server.

That caching is the one trap to remember. A wrong 301 is hard to undo, because you can’t reach into every visitor’s browser and clear it.

302 redirects: the temporary detour

A 302 means Found, and in practice it means temporary. You’re saying, “Use this other URL for now, but keep the original address in mind.”

Search engines usually keep the old URL in their index when they see a 302, since you said the move won’t last. Browsers don’t cache it the same way, so changes show up quickly.

Use a 302 when the original page is coming back, like a short maintenance window or a seasonal campaign.

What each one does to SEO

Here’s where a lot of old advice goes wrong. For years people said a 301 passes ranking power and a 302 doesn’t. Google representatives have said that redirects don’t cost you ranking signals just because you used one. The difference now sits elsewhere.

The real difference is which URL Google chooses to index. A permanent redirect is a strong hint that the new URL should be the canonical one. A temporary redirect is a weak hint, so Google may keep the old URL in search results. If you move a page for good and use a 302, you can end up with the old address ranking while the new one waits.

Time matters too. A 302 that stays in place for months can start to look permanent to Google, and it may eventually treat it that way. But don’t count on it. Say what you mean with the right code.

When to use a 301 and when to use a 302

Ask one question: will the old URL ever come back? If no, use a 301. If yes, use a 302. Here’s how that plays out.

Use a 301 when you:

  • Move to a new domain.
  • Switch from HTTP to HTTPS.
  • Pick one version of your site, such as www or non www.
  • Change your URL structure.
  • Merge two pages into one.
  • Retire a page that has a close replacement.

Use a 302 when you:

  • Run an A/B test that sends some visitors to a variant.
  • Show a maintenance or holiday page for a short time.
  • Send visitors to a regional version based on location.
  • Redirect after a login or a form submit.
  • Promote a limited campaign page.

Can’t decide? Start with a 302 while you test, then switch to a 301 once you’re sure. That avoids the browser caching trap.

What about 307 and 308?

Two newer codes close a gap. Old browsers sometimes changed a POST request into a GET when they followed a 301 or 302. A 307 means temporary and a 308 means permanent, and both keep the original method and body. For web pages the difference rarely matters. For APIs and form posts, it can. Our guide on REST API requests covers how requests and responses work.

Google treats a 308 like a 301 and a 307 like a 302. And if you see a 307 in your browser’s Network tab during an HTTPS upgrade, that’s often the browser’s own HSTS rule, not your server.

Redirect mistakes that hurt rankings

These slips cause most of the damage:

  • Leaving a 302 in place for a permanent move.
  • Building redirect chains, where A goes to B, B goes to C and C goes to D. Each hop slows the page and wastes crawl effort. Point every old URL straight to the final one.
  • Creating redirect loops. A sends to B and B sends back to A. Browsers show an error and bots give up.
  • Sending everything to the homepage. Google can treat an irrelevant redirect as a soft 404, and visitors hate it. Redirect to the closest matching page.
  • Redirecting to a page that returns an error.
  • Blocking the old URL in robots.txt. Crawlers must reach the old URL to see the redirect. Check your file with our robots.txt generator.
  • Forgetting internal links, canonical tags and the sitemap. They should point to the final URL, not the redirected one. Our sitemap generator helps you rebuild a clean list.
  • Using JavaScript or meta refresh redirects when a server redirect is possible.

How to set up a redirect

The method depends on your stack, but the idea is the same everywhere: the server sends the status code and the new address.

  • Apache. Add a line like Redirect 301 /old /new to your config or .htaccess file. For pattern based rules, use rewrite rules.
  • Nginx. Use the return directive with the status code and the full new URL inside the server block.
  • WordPress and other CMS tools. A redirect plugin or the built in manager lets you pick 301 or 302 per rule.
  • CDNs and hosting panels. Most offer redirect rules in the dashboard, and many let you match patterns.

Pattern rules save time but break easily. Test an expression like ^/blog/(\d+)/(.+)$ in our regex tester before you ship it. Keep the whole redirect map in a spreadsheet, and use our CSV to JSON converter if your tool wants JSON instead.

Always test after you deploy. Our redirect checker follows every hop and shows each status code, so you spot chains and loops fast. Our guide on debugging redirect chains shows how to read the results. Special characters in old URLs cause misses too, so check them with our URL encoder decoder.

A safe checklist for site moves

Moving a whole site or section? Work through these steps in order:

  1. List every old URL you can find, from your sitemap, analytics and server logs.
  2. Map each old URL to the closest new URL.
  3. Set up 301 redirects on the server, and make each one point straight to the final address.
  4. Test a sample, then every URL, with a redirect checker.
  5. Update internal links, canonical tags and your sitemap to use the new URLs.
  6. Submit the new sitemap in Google Search Console, and use the change of address tool if you moved domains.
  7. Watch crawl errors and traffic for several weeks.
  8. Keep the redirects live for at least a year.

The short version

Use a 301 when a move is permanent and a 302 when it’s temporary. Google passes ranking signals through both, but a 301 tells it to index the new URL, while a 302 tells it to keep the old one. Avoid chains, loops and homepage dumps, test every redirect and keep permanent ones live for at least a year.

Pick one redirect on your site and run it through a checker today. Thirty seconds can save you months of confusion.

Free browser based tools on Black Claaw to trace redirects, build sitemaps, test patterns and prepare redirect lists.

View all tools

Advertisement