ToolSec

⚙️ DevOps Utilities

301 vs 302 Redirects: Which to Use (and Why It Matters for SEO)

· 6 min read · Updated June 27, 2026

Redirects seem trivial until a botched one drops your traffic. The most consequential decision is also the simplest-sounding: 301 or 302? Getting it right protects your SEO; getting it wrong can quietly waste years of ranking signals.

What a redirect is

A redirect tells a browser (and a search engine) that a resource lives at a different URL. The server responds with a status code in the 3xx range and a Location header pointing to the new address. The two you'll use almost all the time are 301 and 302.

301: permanent

A 301 Moved Permanently says the resource has moved for good. Search engines respond by transferring the old URL's ranking signals — its accumulated link equity — to the new URL, and eventually replacing the old URL in their index with the new one. Browsers may cache a 301 aggressively. Use it whenever the change is permanent:

  • Migrating to a new domain.
  • Restructuring URLs (e.g. /blog/2020/post/articles/post).
  • Switching to HTTPS or consolidating www / non-www.
  • Merging duplicate pages into one canonical URL.

302: temporary

A 302 Found (temporary redirect) says the move is temporary and the original URL will return. Search engines keep the original URL indexed and generally don't pass ranking signals to the destination, because they expect the old page to come back. Use it for genuinely temporary situations:

  • A/B testing a new page version.
  • Sending users to a temporary maintenance or promo page.
  • Geo- or device-based routing that may change per request.

The expensive mistake

Using a 302 for a permanent move is one of the most common and costly SEO errors. Because search engines keep indexing the old URL and withhold ranking signals from the new one, your new page struggles to rank and the old one lingers. If a move is permanent, it must be a 301. When in doubt about a real relocation, choose 301.

Avoid redirect chains

A chain is when one redirect points to another (A → B → C). Chains slow down page loads, waste crawl budget, and can dilute the ranking signals passed along. Always redirect straight to the final destination (A → C). After a migration, also update your internal links to point at the new URLs directly rather than relying on redirects forever.

301 vs 308, 302 vs 307

You may also meet 308 and 307. These are stricter versions that preserve the HTTP method (so a POST stays a POST instead of becoming a GET). For ordinary page moves, 301 and 302 remain the standard choices; reach for 307/308 when method preservation matters, such as redirecting API endpoints.

Generate the rules

Once you've decided, turn your old → new mapping into ready-to-paste Apache .htaccess or nginx config with our redirect generator. If your URLs contain special characters, check them with the URL encoder first, and prototype any pattern matching with the regex tester.

Frequently asked questions

Should I use a 301 or 302 redirect?

Use 301 for permanent moves — it passes ranking signals to the new URL. Use 302 only when the change is temporary and the original URL will return. Using 302 for a permanent move can hurt the new page's SEO.

Does a 301 redirect pass SEO value?

Yes. A 301 transfers most of the old URL's link equity to the destination, which is exactly what you want during a migration or permanent URL change.

Why are redirect chains bad?

Chains (A → B → C) slow page loads, waste crawl budget and can dilute ranking signals. Always redirect straight to the final destination and update internal links to the new URLs.

Try the related tools

Related guides