301 vs 302 Redirects: Which to Use (and When)

A redirect sends a visitor (and a search engine) from one URL to another. The difference between a 301 and a 302 redirect is whether the move is permanent or temporary, and that distinction changes how search engines treat the original URL. Understanding 301 vs 302 redirects helps you avoid mistakes that cost rankings.

301: Moved Permanently

A 301 tells search engines the original URL has permanently moved to the new one. The expected behavior:

  • Search engines transfer most ranking signals from the old URL to the new one.
  • The old URL is eventually dropped from the index.
  • Browsers and caches may remember the redirect.

Use a 301 when:

  • You renamed or moved a page permanently.
  • You merged two pages into one.
  • You changed your domain or protocol (http → https).
  • You consolidated duplicate URLs (www → apex, trailing slash).

302: Found (Temporary)

A 302 tells search engines the original URL is temporarily unavailable and the new URL should be used for now. The expected behavior:

  • Search engines keep the original URL in the index.
  • Ranking signals generally stay with the original URL.
  • The redirect may not be cached as aggressively.

Use a 302 when:

  • A page is temporarily down for maintenance and you want to send visitors to a status page.
  • You are A/B testing a different version of a page.
  • A product is temporarily out of stock and you want to redirect to a category page, but plan to restore it.

307 and 308

  • 307 Temporary Redirect. Like a 302, but guarantees the HTTP method (GET stays GET, POST stays POST) is not changed. Use for temporary redirects of form submissions.
  • 308 Permanent Redirect. Like a 301, but also guarantees the method is preserved. Use for permanent redirects of POST endpoints.

For normal page moves, 301 and 302 are sufficient and widely supported.

How to test a redirect

The quickest way to see what a URL does is to read its response headers. On a command line:

curl -I https://example.com/old-page/

The first line of the reply shows the status, and the Location header shows where the visitor is sent:

HTTP/2 301
location: https://example.com/new-page/

To follow a chain and see every hop, use -i with -L:

curl -sIL https://example.com/old-page/ | grep -E '^HTTP|^location'

A redirect chain shows several HTTP lines. If you see more than one hop, fix the links so they point straight at the final URL. The Dead Link Checker finds chains across a whole site without you typing a command.

How to set up redirects

The exact file depends on your server.

Apache (.htaccess):

Redirect 301 /old-page/ https://example.com/new-page/

nginx (server block):

return 301 https://example.com/new-page/;

Cloudflare (Rules → Redirect Rules): Create a "301 URL Redirect" rule with the old path as the matching filter and the new URL as the destination, set the status to 301 or 302, and leave "Preserve query string" on unless you want to drop it.

For a bulk rename, a server rule beats editing every link by hand, but always check the result with curl -I afterwards. Last updated: October 31, 2026.

How they affect SEO

  • 301 passes ranking signals. Google treats the new URL as the successor of the old one. Most link equity transfers.
  • 302 keeps signals on the original. If you 302 a page that has backlinks, those links still point at the original URL in Google's view. The destination may not gain much.
  • Chains waste signals. Every hop in a redirect chain loses a little. Keep it to one hop.
  • Wrong type for too long. A 302 left in place for months is often treated like a 301 by Google, but relying on that is risky.

Common mistakes

  • Using 302 for a permanent move. The old URL stays indexed and the new one may not gain rankings. Always use 301 for permanent moves.
  • Using 301 for a temporary change. The old URL gets dropped from the index, and when you remove the redirect, it has to re-earn its position.
  • Redirect chains. /a → /b → /c loses signals and slows crawling. Redirect straight to the final URL.
  • Redirecting to an irrelevant page. Sending a deleted product page to the homepage instead of a relevant category confuses both users and search engines.
  • Forgetting to update internal links. A 301 masks the problem but wastes a hop. Update links to point directly at the new URL.

Decision checklist

Ask three questions:

  1. Is the move permanent? If yes → 301 (or 308 for POST endpoints).
  2. Is the move temporary and will the original come back? If yes → 302 (or 307).
  3. Am I redirecting to a relevant replacement? If no → reconsider; a 404 or 410 may be more honest.

FAQ

When should I use a 301 instead of a 302?

Use a 301 when the move is permanent: a renamed page, a merged page, a domain change, or a protocol change (http to https). Use a 302 when the original URL will come back, such as during maintenance, an A/B test, or while a product is temporarily out of stock.

What is the difference between 302 and 307?

Both mean "temporary redirect," but 307 guarantees the HTTP method is preserved (a POST stays a POST). Use 307 for temporary redirects of form submissions, and 302 for ordinary page moves.

What is the difference between 301 and 308?

Both mean "permanent redirect," but 308 also guarantees the HTTP method is preserved. Use 308 for permanent redirects of POST endpoints, and 301 for ordinary page moves.

How do I test a redirect?

Open a terminal and run curl -I https://example.com/old-page/. The first line of the reply shows the status code, and the Location header shows where the visitor is sent. To follow a chain and see every hop, use curl -sIL https://example.com/old-page/ | grep -E '^HTTP|^location'.

Does a 301 pass ranking signals to the new page?

Yes. Google treats the new URL as the successor of the old one and transfers most of the link equity. A 302 keeps the signals on the original URL, so the destination may not gain much. Every hop in a redirect chain loses a little, so redirect straight to the final URL.

How long should I keep a 301 redirect?

Keep it in place for at least a year, and longer if the old URL had backlinks or was well known. Search engines need time to notice the move and drop the old URL from their index. Removing a 301 before the new page has earned its place can cost rankings.

Where can I see the exact lines to paste?

The practical part is our How to Set Up a 301 Redirect guide, with copy-paste rules for Apache, Nginx, Cloudflare Pages and Netlify, plus how to test them.

Where to go next

Run the Dead Link Checker to find redirect chains and broken links on your site. Then read How to Fix Duplicate URLs and Canonical Issues for the canonical side, How to Find and Fix Broken Links for the broader link audit, and XML Sitemaps: What They Do and Do Not Do for the sitemap side. Google's redirects documentation covers the official guidance.

Try it on your own content

The Dead Link Checker checks content against these practices in seconds. Free and no sign-up; see the tool page for how analysis works.

Meet the Dead Link Checker