Auditite
Back to blog
Technical SEO Technical SEO Audit 2026-10-12 9 min read

301 vs 302 Redirect: Which One to Use for SEO

301 vs 302 redirect explained: how Google treats each, when 307 and 308 apply, server config for Apache, Nginx and Cloudflare, and how to fix redirect chains.

A

Auditite Team

redirects301 redirect302 redirecttechnical SEOsite migration

The 301 vs 302 question sounds like trivia until a site migration goes wrong. A batch of old URLs is redirected with the wrong status code, Google keeps the old URLs as canonical for months, and the team spends weeks wondering why the new pages will not rank.

The short answer is simple: use a 301 (or 308) when the move is permanent, and a 302 (or 307) only when you genuinely plan to bring the old URL back. The long answer is about what each code tells Google, why so many tools default to the wrong one, and how to audit the redirects you already have.

What 301 and 302 Actually Mean

Both are HTTP status codes in the 3xx family. When a browser or crawler requests a URL, the server answers with the status code plus a Location header pointing at the new address.

CodeNameMeaningRequest method kept?
301Moved PermanentlyThe resource has a new permanent homeNot guaranteed (clients may switch POST to GET)
302FoundThe resource is temporarily elsewhereNot guaranteed
307Temporary RedirectTemporary, and the method must not changeYes
308Permanent RedirectPermanent, and the method must not changeYes

For SEO purposes, 301 and 308 behave the same way (permanent), and 302 and 307 behave the same way (temporary). The method-preservation difference matters for APIs and form submissions, not for ranking.

How Google Treats 301 vs 302 Redirects

Google documents this clearly in its Search Central guidance on redirects:

  • A permanent redirect (301, 308) is a strong signal that the target URL should be the canonical one. Google moves the old URL out of the index and consolidates signals onto the new URL.
  • A temporary redirect (302, 307) is a weak signal that the target should be canonical. Google tends to keep the original URL in the index, because you told it the move is temporary.

That is the practical difference. It is not that a 302 “leaks link equity.” Google has stated that redirects do not lose PageRank. The real risk is canonicalization: with a 302, Google may keep showing the old URL in search results and treating it as the primary version.

Google has also said that if a temporary redirect stays in place long enough, it may eventually be treated as permanent. Do not rely on that. “Eventually” is undefined, and during a migration you want consolidation to happen as fast as possible.

When to Use Each Redirect

Use a 301 or 308 when:

  • You change a URL slug, permanently.
  • You migrate from HTTP to HTTPS or from www to non-www (or the reverse).
  • You move to a new domain.
  • You merge two pages into one, or retire a page and point it at the closest replacement.
  • You restructure categories or folders.

Use a 302 or 307 when:

  • A product is temporarily out of stock and you send visitors to a category page for a few days.
  • You run a short promotion and redirect a URL to a campaign page, then switch it back.
  • You route users based on device, login state or A/B test assignment, and the original URL is still the “real” page.
  • Maintenance takes a page offline briefly (though a 503 with Retry-After is often better for site-wide maintenance).

Neither: when to return 404 or 410 instead

If a page is gone and there is no close equivalent, do not redirect it to the homepage. Google tends to treat irrelevant redirects to the homepage as soft 404s anyway, and users land somewhere confusing. Return a 404 or 410 and let it drop out. Our guide to managing 404 errors and redirects covers how to decide.

What Most People Get Wrong: Tool Defaults Are Often 302

Here is the part that causes real damage. Many tools and frameworks issue a 302 by default unless you explicitly ask for a 301:

  • Express.js res.redirect('/new') sends a 302 unless you pass the status: res.redirect(301, '/new').
  • PHP’s header('Location: /new') sends a 302 unless you set the status code.
  • Cloudflare Pages _redirects rules default to 302 when no status is given.
  • Many CMS “redirect” fields and marketing tools create temporary redirects by default.

Nobody chooses a 302 for a permanent URL change. They just accept the default. That is why the first step in any redirect audit is not “are there redirects?” but “what status code does each redirect actually return?”

Configuration Examples

Apache (.htaccess)

Simple one-to-one redirect:

Redirect 301 /old-page /new-page

Pattern-based redirect with mod_rewrite:

RewriteEngine On
RewriteRule ^blog/category/(.*)$ /blog/$1 [R=301,L]

Force HTTPS and non-www in one hop:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

Nginx

location = /old-page {
    return 301 /new-page;
}

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;
}

Use return 301 rather than rewrite ... permanent where you can; it is clearer and faster.

Cloudflare

For sites behind Cloudflare, you have two common options:

  • Redirect Rules / Bulk Redirects in the dashboard. Choose status code 301 explicitly; for bulk lists, upload a CSV of source and target URLs.
  • Cloudflare Pages _redirects file in the build output:
/old-page /new-page 301
/blog/category/* /blog/:splat 301

Always add the 301. Leave it off and you get a 302.

WordPress

Plugins such as Redirection or the redirect managers in Yoast SEO Premium and Rank Math let you choose the type per rule. Check the default in each plugin’s settings, then spot-check a few rules with a redirect checker.

Redirect Chains and Loops

A redirect chain is when URL A redirects to B, which redirects to C. They build up naturally over years: an HTTP to HTTPS rule, then a trailing-slash rule, then a slug change.

http://example.com/Old-Page
  301 → https://example.com/Old-Page
  301 → https://example.com/old-page
  301 → https://example.com/old-page/
  302 → https://example.com/new-page/

Why chains matter:

  • Googlebot follows a limited number of hops (Google documents up to 10) before giving up on the redirect for that crawl attempt.
  • Every hop adds latency for users, which is noticeable on mobile connections.
  • One temporary hop anywhere in the chain muddies the canonical signal, as in the example above.

The fix is to point every source URL directly at the final destination with a single 301. When you add a new redirect, also update existing rules that point at the old target.

A redirect loop (A → B → A) makes the page unreachable. Browsers show an error, and Google cannot index either URL. Loops usually come from conflicting rules at two layers, for example a CDN forcing HTTPS while the origin forces HTTP.

How to Audit Your Redirects

  1. Crawl the site with your audit tool and export every URL that returns a 3xx status, with its status code and final destination.
  2. Filter for 302 and 307. For each, ask: is this genuinely temporary? If not, change it to 301.
  3. Filter for chains (more than one hop) and rewrite the first rule to point at the final URL.
  4. Check internal links. Internal links should point at final URLs, not at redirected ones. Update templates, navigation and in-content links.
  5. Check your XML sitemap. Sitemaps should list only final, 200-status, canonical URLs. A sitemap full of redirected URLs sends mixed signals.
  6. Verify in Search Console. Use URL Inspection on a few old URLs to see which URL Google selected as canonical.

During migrations, keep the redirect map in a spreadsheet so every rule has an owner and a reason. Our redirect mapping template and site migration SEO checklist give you a starting structure.

A Worked Example

A blog changes its URL structure from /2024/05/post-name/ to /blog/post-name/. A developer adds this to .htaccess:

RewriteRule ^\d{4}/\d{2}/(.*)$ /blog/$1 [R,L]

[R] without a code is a 302 in Apache. Three months later, Search Console still shows many of the old dated URLs as the Google-selected canonical, and the new URLs sit under “Alternate page with proper canonical tag” or are not indexed.

The fix is one character set:

RewriteRule ^\d{4}/\d{2}/(.*)$ /blog/$1 [R=301,L]

After that, internal links in old posts are updated to the new URLs, the sitemap is regenerated, and the old URLs drop out over the following weeks as Google recrawls them.

Frequently asked questions

Is a 301 or 302 redirect better for SEO?

For permanent URL changes, a 301 is better because it tells Google to treat the new URL as canonical and consolidate signals there. A 302 is correct only when the move is temporary and you want the original URL to stay indexed.

Google has said redirects do not lose PageRank. The practical problem with a 302 is canonicalization: Google may keep the old URL indexed instead of the new one.

What is the difference between 301 and 308?

Both are permanent. A 308 guarantees the request method is preserved, so a POST stays a POST. For normal page URLs, Google treats them the same way.

How long should I keep 301 redirects in place?

As long as possible, and at least a year for migrations. Old URLs keep receiving links and bookmarks, so removing redirects later turns that traffic into 404s.

How many redirects in a chain are too many?

Aim for one hop. Google documents following up to 10 hops, but every extra hop adds latency and risk, so point old URLs straight at the final destination.

Stay in the loop

Get insights, strategies, and product updates delivered to your inbox.

No spam. Unsubscribe anytime.

Ready to see Auditite in action?

Get started and see how Auditite can transform your SEO auditing workflow.

Get started
Get started

Get insights delivered weekly

Join teams who get actionable playbooks, benchmarks, and product updates every week.