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

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

A redirect sends users and search engines from one URL to another. The status code you choose tells search engines whether the move is permanent or temporary, and that decides which URL stays in the index. Choosing the wrong one rarely breaks a site, but it can keep the wrong URL in Google for months.

The redirect codes

  • 301 Moved Permanently: the page has moved for good. Google replaces the old URL with the new one and transfers ranking signals.
  • 308 Permanent Redirect: the same as 301, but the browser must keep the request method (for example a form POST). Google treats it like a 301.
  • 302 Found: a temporary move. Google keeps the original URL indexed, as long as the redirect looks temporary.
  • 307 Temporary Redirect: the temporary version that keeps the request method. Treated like a 302.

When to use each one

  • 301 for changed URLs, merged pages, a move to HTTPS, a new domain or a site migration.
  • 302 for short-term changes: a page under maintenance, a temporary promotion, an A/B test or a redirect based on the user’s location.
  • If you are not sure, ask yourself whether the old URL will ever come back. If not, use a 301.

Do redirects lose PageRank?

Google has stated that 301, 302 and 308 redirects do not lose PageRank. The practical difference is which URL Google shows: with a 301 it is the new one, with a 302 it usually keeps the old one. If a 302 stays in place for a long time, Google may start treating it as permanent.

Redirect chains and loops

A chain is a sequence of redirects, such as http://example.com to https://example.com to https://www.example.com. Each hop adds latency, and Googlebot follows a limited number of hops. A loop is a chain that never ends. Both are common after migrations.

  • Redirect every old URL straight to its final destination in one hop.
  • Update internal links so they point to final URLs, not to redirected ones.
  • After a migration, keep the old redirects for at least a year, and ideally forever if the old URLs have backlinks.

See every hop and its status code with our Redirect Checker, and check the final page with the HTTP Header Checker.

How to create redirects

  • WordPress: plugins such as Redirection or the redirect module in Rank Math.
  • Apache: rules in the .htaccess file.
  • Nginx: return or rewrite directives in the server configuration.
  • CDN: redirect rules in Cloudflare or similar services, which run before the request reaches your server.

Frequently asked questions

Is a meta refresh or JavaScript redirect OK for SEO?

Google can follow them, but they are slower and less reliable than server-side 301 redirects. Use HTTP redirects whenever you can.

Should I redirect deleted pages to the home page?

No. Redirect them to the closest relevant page. If there is none, a 404 or 410 is better: Google treats mass redirects to the home page as soft 404s.

How long should I keep 301 redirects?

At least one year after a migration. Keep them longer if the old URLs still receive traffic or backlinks.