Technical SEO

301 and 302 redirects: when and how to use them

301 and 302 redirects: when and how to use them

Redirects are one of the fundamental tools of technical SEO. Choosing the wrong type between 301 and 302 costs you link equity and rankings. We cover all redirect codes, usage scenarios, and server-side configuration.

A redirect is an instruction to the server: 'The requested URL has moved. Here is the new address.' The browser and search crawler receive an HTTP code and a new URL, then navigate there automatically. For users it's invisible; for SEO — choosing the right type is critical.

The key rule: 301 when a page has moved permanently. 302 when it has moved temporarily and will return. Use 302 only where that is genuinely true. In all other cases — use 301.

What are redirects

An HTTP redirect is a server response with a 3xx code that indicates the resource is located at a different URL. The browser automatically follows the new address; the search crawler does the same and updates its index depending on the redirect type.

301

Permanent

Passes up to 99% of link equity. Pages consolidate in Google within weeks

302

Temporary

Does not pass link equity. The source URL stays in the index

~1 ms

Delay

A properly configured redirect adds less than 1 ms to response time

≤3

Hops in chain

Maximum recommended redirect chain length

301: permanent redirect

301 Moved Permanently tells the browser and crawler that a page has moved forever. Google passes link equity (PageRank) from the source URL to the new one, updates its index, and starts showing the new URL in search results.

When to use 301

ScenarioExample
Domain migrationold-domain.com → new-domain.com
Removing a page with an alternative/old-product → /new-product
Merging duplicate URLs/page and /page/ → /page/ (consistent trailing slash)
HTTP → HTTPShttp://site.com → https://site.com
www → non-www (or vice versa)www.site.com → site.com
URL restructuring/blog/2020/post → /blog/post

302: temporary redirect

302 Found is a temporary redirect. Google does not pass link equity and does not update its index: the source URL remains canonical. Use it only when the page is genuinely temporarily unavailable and will return to its original address.

When to use 302

ScenarioExample
A/B testingTesting a new page version without losing rankings for the original
Geo-redirectRedirecting to a country/language with the ability to return
Temporary promotionPromo page → main sale page (only while active)
MaintenanceRedirecting during server maintenance
If you're unsure whether a redirect is temporary or permanent — use 301. Mistakenly using 302 instead of 301 is a very common issue. Google may eventually treat 302 as permanent, but this is unpredictable and takes time.

307, 308 and other codes

CodeNameHTTP methodSEO meaning
301Moved PermanentlyMay change (GET→GET)Permanent, passes PageRank
302FoundMay change (POST→GET)Temporary, no PageRank pass
307Temporary RedirectPreserved (POST→POST)Temporary, strict method
308Permanent RedirectPreserved (POST→POST)Permanent, strict method
303See OtherAlways GETAfter POST → redirect to GET
410GonePage permanently deleted, no alternative

For most SEO tasks, 301 and 302 are sufficient. Codes 307 and 308 are used in APIs and web applications where preserving the HTTP method matters. Code 410 signals to Google that a page is permanently deleted — it clears from the index faster than a 404.

SEO impact

A 301 redirect passes up to 99% of link equity — according to Google. In practice, positions may temporarily dip after a migration and recover within weeks. This is normal and not a permanent loss.

When to use 301 vs 302 redirect — visual comparison.
Aspect301302
PageRank transferUp to 99% (per Google)None
Canonical URL in indexNew URLSource URL
Index update speedSeveral weeksNot updated
Ranking impactTemporary dip, then recoveryRankings stay with source URL
Browser cache durationLong (until changed)Not cached or briefly

Redirect chains

A redirect chain is when URL-A → URL-B → URL-C instead of URL-A → URL-C. Each additional hop reduces the PageRank passed, increases load time, and complicates crawling for Googlebot.

The maximum recommended chain length is 3 hops. Chains of 5+ hops may be cut short by Google before reaching the final URL. Regularly audit chains with tools (Screaming Frog, Redirect Checker) and flatten them.

BASH
# Check redirect chain via curl
curl -L -s -o /dev/null -w "%{url_effective}\n%{http_code}\n%{redirect_url}\n" \
  https://old-domain.com/page

# Check all redirects in the chain
curl -L -v https://old-domain.com/page 2>&1 | grep -E "^< HTTP|^> GET|Location:"

Server configuration

Nginx

NGINX
# 301: permanent redirect for a single page
server {
  location = /old-page {
    return 301 /new-page;
  }
}

# 301: full domain redirect
server {
  server_name old-domain.com;
  return 301 https://new-domain.com$request_uri;
}

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

# 302: temporary redirect
server {
  location = /promo {
    return 302 /sale;
  }
}

Next.js (next.config.ts)

TYPESCRIPT
// next.config.ts
const nextConfig = {
  async redirects() {
    return [
      // 301: permanent redirect
      {
        source: '/old-blog/:slug',
        destination: '/blog/:slug',
        permanent: true, // = 301
      },
      // 302: temporary redirect
      {
        source: '/promo',
        destination: '/sale',
        permanent: false, // = 302
      },
    ];
  },
};

export default nextConfig;

Common scenarios

ScenarioTypeNotes
HTTPS migration301http://... → https://... for all URLs
www normalisation301www.site.com → site.com (or vice versa)
Trailing slash301/page → /page/ or vice versa — consistently
Domain migration301old.com → new.com preserving URL structure
Removing a page301 or 410→ nearest topical page, or 410 if no alternative
Seasonal promotions302→ promo page only while active
A/B testing302→ variant B without losing variant A rankings

FAQ

According to Google — losses are minimal (up to 99% is passed). In practice, rankings may temporarily drop after a migration due to re-indexing delay. Usually within 2–8 weeks, rankings recover or improve if the migration was done correctly.
301 is more reliable — it's a directive that Google must follow. Canonical is a hint that Google can ignore. If a page is no longer needed as a separate URL, use a 301. Keep canonical for cases where both URLs must remain technically accessible.
From several days to several weeks. Depends on crawl frequency. To speed it up: add the new URL to the sitemap, update internal links, request re-indexing of the new URL via GSC. The old URL disappears from the index gradually.
Definitely. Tools: curl (command line), Redirect Checker (online), Screaming Frog (for bulk checking). Verify: correct response code (301, not 302), no redirect chain, the final URL is canonical without further redirects.
Three options: 1) 301 to the nearest topical page — best option when an alternative exists. 2) 410 Gone — if the page is permanently deleted and there's no alternative: Google clears it from the index faster. 3) 404 — acceptable, but Google removes it from the index more slowly than with a 410.