Back to Blog

301 vs 302 Redirect: When to Use Each

A 301 tells browsers and Google a move is permanent; a 302 says it is temporary. Pick the wrong one and you can strand visitors on a cached redirect that is painful to undo.

Karan Bhakuni
Karan Bhakuni
Founder, Flyn
TechnicalJul 2, 202614 min readUpdated Aug 6, 2026
301 vs 302 Redirect: When to Use Each

What an HTTP Redirect Actually Is

The short answer: a 301 redirect tells browsers and search engines a page has moved permanently, so browsers cache the new address and Google transfers ranking signals to it. A 302 redirect says the move is temporary, so nothing is cached and the original URL stays indexed. Use a 301 for moves you will never undo, and a 302 for anything you might reverse.

SituationCode to use
Domain move or HTTPS migration301
Renamed, merged, or retired page301
A/B test or geo routing302
Campaign page or maintenance window302
Redirect that must keep a POST307 temporary, 308 permanent

You move a page, ship a redirect, and everything looks fine. Six months later a form silently drops its submissions, rankings drift, and a URL you already fixed keeps sending visitors to the wrong place because their browsers memorized the old rule. Nearly every one of those failures traces back to one choice: 301 or 302. This guide gives SEOs, developers, and site owners a precise answer: what each status code tells browsers and search engines, where 303, 307, and 308 fit, and how to verify what your server actually sends with the free redirect checker.

The request and response flow

An HTTP redirect is an ordinary HTTP response that says "not here, go there," in four steps:

  1. Your browser requests https://example.com/old-page.
  2. The server answers with a 3xx status code and a Location header: Location: /new-page.
  3. The browser automatically fires a second request at the new URL.
  4. The server responds with the real content and a 200 OK.
Four step diagram showing a browser requesting an old URL, the server returning a 3xx response with a Location header, the browser re-requesting the new URL, and the server answering 200 OK with content
Every redirect is two round trips: a 3xx response carrying a Location header, then a fresh request to the destination.

Visitors land on the destination either way; they never see the difference. But three behaviors hinge entirely on the code you pick: caching (does the browser remember the redirect and skip your server next time), method preservation (does a POST stay a POST), and search signals (which URL Google treats as canonical).

301 vs 302: The Precise Difference

Both codes live in the 3xx block, both carry a Location header, and both move the visitor. The difference is a promise about the future.

301 Moved Permanently

A 301 Moved Permanently says the resource has a new home forever, and everything downstream may act on that permanence:

  • Browsers can cache the redirect aggressively and stop asking your server about the old URL.
  • Search engines transfer indexing signals to the destination and drop the old URL from results.
  • Anything holding the old address (bookmarks, feeds, crawlers) is invited to update its records.

302 Found: the accidental default

A 302 Found (named Moved Temporarily in HTTP/1.0) says the resource is elsewhere right now, but the original URL remains the real address, so clients keep checking it on future visits and search engines keep it indexed.

The trap: 302 is the framework default almost everywhere. Express's res.redirect(), PHP's header('Location: ...'), and most CMS plugins emit a 302 unless you say otherwise, which is how thousands of permanent moves accidentally ship as temporary ones. The reverse mistake is worse: shipping a quick experiment as a 301 that browsers refuse to forget.

The one-line rule: a 301 is a promise, a 302 is a placeholder. Only promise what you will not take back.

303, 307, and 308: The Rest of the 3xx Family

Three more codes matter in practice, and all three exist to clean up one historical mess: method rewriting. Early browsers rewrote POST requests to GET when following a 301 or 302, the spec eventually surrendered to reality, and today a 301 or 302 may legally change your HTTP method. The newer codes remove that ambiguity.

303 See Other: always a GET

A 303 See Other explicitly instructs the client to fetch the destination with GET, whatever the original method was. It is the correct code for the POST-redirect-GET pattern: a form submits, the server processes it, and the browser lands on a results page that is safe to refresh without resubmitting.

307 Temporary Redirect: a 302 with discipline

A 307 Temporary Redirect means the same thing as a 302 with one hard guarantee: the client must not change the method or body. A POST stays a POST. If a redirect might ever sit in front of an API endpoint, a webhook receiver, or a form handler, 307 is the temporary code you want.

308 Permanent Redirect: a 301 with discipline

A 308 Permanent Redirect (RFC 7538) is the permanent twin: permanent like a 301, method-preserving like a 307. The whole family side by side:

CodeNamePermanenceMethod preserved?Cached by default?
301Moved PermanentlyPermanentNo, POST may become GETYes, aggressively
302FoundTemporaryNo, POST may become GETOnly with explicit cache headers
303See OtherTemporaryNo, always becomes GETOnly with explicit cache headers
307Temporary RedirectTemporaryYes, alwaysOnly with explicit cache headers
308Permanent RedirectPermanentYes, alwaysYes, like a 301

For browser-facing pages, 301 and 302 work fine because page navigations are GETs. The moment a redirect can receive a POST, PUT, or DELETE, reach for 307 or 308.

Browser Caching: The 301 Gotcha

Caching is where 301 and 302 stop being interchangeable, and where most real-world redirect pain comes from.

Why 301s are so sticky

Under HTTP caching rules, a 301 (and a 308) is heuristically cacheable: a browser may store and reuse it even when the response carries no caching headers at all, and Chrome, Firefox, and Safari all do. After a single visit, the browser rewrites /old-page to /new-page locally and may never contact your server about the old URL again. A 302 or 307 is only cached with explicit freshness headers such as Cache-Control: max-age, so by default every visit re-checks the server.

A cached 301 behaves like a tattoo:

  • Delete the rule from your server and returning visitors still get redirected; their browser never asks.
  • Point a 301 at the wrong destination and the mistake is stored on devices you do not control.
  • There is no remote flush. You cannot clear a visitor's cache from your side.

How to recover from a wrong 301

  1. Fix it at the destination. Misdirected visitors still reach the wrong target, so redirect that page onward to the correct one; cached browsers follow their stored 301 straight into your fix.
  2. Restore the original URL with a 200 so new visitors and expired caches get the right page.
  3. Give future redirects explicit cache headers like Cache-Control: max-age=3600, so cached copies expire within an hour of a change.
Watch out

Never prototype with a 301. Ship every new redirect as a 302 first, confirm it behaves in the Redirect Checker for a few days, then upgrade it to a 301 once you are certain. Downgrading a cached 301 costs weeks; upgrading a 302 costs nothing.

The SEO Impact: What Google Actually Does

The SEO folklore around 301 vs 302 is a decade out of date, so let's reset it against what Google has actually said.

PageRank passes through every 3xx

For years SEOs treated 302s as a link equity leak and claimed even a 301 burned around 15 percent of PageRank, the damping a normal link applies. Google retired both ideas in 2016, when analyst Gary Illyes put it flatly:

30x redirects don't lose PageRank anymore. (Gary Illyes, Google, 2016)

John Mueller has since confirmed that Google forwards PageRank through 301s and 302s alike, and that long-running redirects of either type are treated "exactly the same." No redirect tax, no percentage haircut, whichever code you serve.

Canonicalization: the difference that remains

What still differs is canonicalization, meaning which URL Google chooses to index and display:

  • A 301 or 308 strongly hints the destination is canonical: signals consolidate onto the new URL quickly and the old one drops out of the index.
  • A 302 or 307 hints the source is still canonical, so Google tends to keep the original URL indexed at first.
  • Leave a 302 up long enough and Google usually concludes the move is permanent and treats it like a 301 anyway.
Timeline chart comparing a 301 redirect consolidating search signals onto the destination URL quickly against a 302 redirect where Google keeps the source URL indexed before slowly treating the redirect as permanent
Both codes pass full PageRank; the difference is how quickly Google settles on which URL to index.

Translation: you will not lose rankings by picking the "wrong" one, but a permanent move shipped as a 302 consolidates slower and can leave stale URLs lingering in results. During a site migration that ambiguity is the last thing you want; our website migration redirect guide is the full playbook. Also confirm redirects and canonical tags agree using the canonical URL checker: a redirect to page A plus a canonical tag pointing at page B hands Google contradictory hints.

Which One Should You Use? The Decision Guide

Strip away the folklore and the choice is mechanical. Ask two questions: is the move permanent, and does the HTTP method need to survive the hop?

Decision flowchart asking whether a move is permanent and whether the HTTP method must be preserved, routing to status code 301, 308, 302, or 307 accordingly
Two questions pick the code: permanence selects the 301/308 or 302/307 family, and method sensitivity selects the strict variant.

Use a 301 (or 308) when the move is forever

  • Domain migrations: oldbrand.com to newbrand.com, every URL mapped one to one.
  • HTTPS migrations: http to https, the textbook permanent redirect (add HSTS once stable so browsers skip the hop entirely).
  • Host consolidation: picking www or non-www and redirecting the loser.
  • Renamed, merged, or retired content: old slugs to their successors.
  • Normalization rules (trailing slashes, lowercase paths) that will never change.

Pick 308 over 301 only when the redirected traffic includes non-GET requests, such as a moved API path that still receives POSTs.

Use a 302 (or 307) when you will take it back

  • A/B tests that send a share of visitors to a variant (a link rotator does this at the link layer, zero server config).
  • Geo and device routing: German visitors to /de, Android users to the Play Store, the job smart routing performs for short links.
  • Temporary campaigns: a Black Friday page that reverts in December.
  • Maintenance windows and out-of-stock fallbacks.
Pro tip

When you genuinely cannot decide, choose 302. Google eventually treats a long-lived 302 as permanent anyway, and you keep the freedom to change your mind. The asymmetric risk sits entirely on the 301 side because of browser caching.

Implementing Redirects on Your Stack

The concept is identical everywhere; only the syntax changes. Here is the map, with a free generator for each stack.

Server level: Apache and Nginx

On Apache, one line in .htaccess covers most cases, Redirect 301 /old-page /new-page, with RewriteRule for pattern matches; the htaccess redirect generator writes the exact block, wildcards included. On Nginx, use return 301 /new-page; inside a location block or a rewrite directive for regex maps; the Nginx redirect generator outputs both forms. Server-level rules are fastest because they answer before any application code runs.

CMS and hosted platforms

Watch the defaults: hosted platforms often assume every redirect is permanent. If yours only offers a 301, do not use it for anything you plan to reverse.

Meta refresh: the last resort

When you cannot touch server config at all, a meta refresh tag in the page head can stand in: <meta http-equiv="refresh" content="0;url=/new-page">. Google treats an instant (zero second) meta refresh as a permanent redirect signal, but it is slower for users and invisible to HTTP tooling. Treat the meta refresh generator as the fallback, never the first choice.

Debugging: Chains, Loops, and Verification

Redirect bugs are invisible in the browser, which silently follows whatever it receives. To debug, look at the raw responses.

Verify the status code you think you are serving

Never assume the code: frameworks default to 302, CDNs inject their own rules, and plugins fight each other. Two ways to see the truth:

  • Run the URL through the free Redirect Checker to see every hop with its exact status code and headers.
  • From a terminal, curl -sIL https://example.com/old-page prints each status line and Location header.

For a link whose destination you do not know, the URL expander unrolls the full path without you clicking it, and the short link safety checker flags dangerous endpoints along the way.

Chains and loops: every hop costs you

A redirect chain is a redirect pointing at another redirect: http to https to www to the new slug is already three hops. Users pay a round trip per hop, Googlebot abandons a chain after 10 hops, and long chains waste crawl budget. Three rules:

  1. Redirect straight to the final destination, collapsing intermediate rules.
  2. Update internal links to point at final URLs; a broken link checker pass finds the stragglers.
  3. Confirm every hop keeps your campaign tags with the UTM redirect preservation checker; a redirect that strips UTM parameters quietly destroys attribution.

A redirect loop, the dreaded ERR_TOO_MANY_REDIRECTS, means the chain never terminates: A points to B, B points back to A. The usual culprit is two layers fighting, classically a CDN forcing HTTPS while the origin redirects back to HTTP. Let exactly one layer own each rule.

Frequently Asked Questions

Is a 301 or 302 redirect better for SEO?
Neither is better in a raw ranking sense. Google confirmed in 2016 that all 3xx redirects pass PageRank without loss, and John Mueller has said that long-running 301s and 302s are treated exactly the same. The practical difference is canonicalization: a 301 tells Google to index the destination immediately, so signals consolidate faster and the old URL drops out of results cleanly, while a 302 keeps the original URL in the index at first. Match the code to reality: permanent moves get a 301, temporary detours get a 302, and the SEO takes care of itself.
Do 301 redirects lose PageRank?
No. The old belief that each 301 leaked around 15 percent of PageRank, matching the damping factor of a normal link, was retired in 2016 when Google's Gary Illyes stated publicly that 30x redirects no longer lose PageRank. That applies to 301, 302, 307, and the rest of the family. What can still hurt you is sloppiness around redirects: long chains that slow crawling, mass redirects pointing at irrelevant pages (Google can treat a blanket redirect to your homepage as a soft 404), and internal links that still point at old URLs. Keep redirects direct, relevant, and few.
How long do browsers cache a 301 redirect?
Potentially for a very long time. A 301 without explicit caching headers is heuristically cacheable, which means the browser picks its own freshness lifetime, and in practice Chrome, Firefox, and Safari hold onto 301s until something evicts them: a cleared cache, a hard reload of the old URL, or an expiry you provided. You cannot flush a visitor's cache remotely. If you want a permanent redirect that stays reversible on your schedule, attach a header such as Cache-Control: max-age=3600 so every cached copy in the wild expires within an hour of any change you make.
How do I undo a 301 redirect that was a mistake?
Work from the destination, because browsers holding the cached 301 will never ask your server about the old URL again. If the redirect pointed at the wrong page, add a new redirect from that wrong destination onward to the correct one; cached visitors follow their stored rule straight into your fix. If traffic needs to return to the original URL itself, restore it with a 200 response and accept that cached visitors will not come back until their cache expires or they force a reload. Verify every hop with the Redirect Checker, and prototype with 302s next time.
What is the difference between a 302 and a 307 redirect?
Both are temporary, and both leave the original URL as the canonical address. The difference is method handling. A 302 permits the client to change the HTTP method when following the redirect, and browsers historically rewrite POST to GET, which silently discards the request body. A 307 forbids that: the method and body must be replayed unchanged against the new URL. For ordinary page navigation the two behave identically, since page loads are GET requests. Choose 307 whenever redirected traffic can include form submissions, API calls, or webhooks, where a dropped POST body means lost data.
When should I use a 308 instead of a 301?
Use a 308 when the move is permanent and the redirected requests might not be GETs. Typical cases include an API endpoint that moved paths but still receives POST, PUT, or DELETE calls, a form handler with a new URL, or a webhook receiver that changed addresses. A 301 allows clients to rewrite the method to GET, which breaks all of those. For regular web pages a 301 remains perfectly fine and enjoys universal support, while 308 is safe in all modern browsers and HTTP clients but can confuse very old software. Same permanence, same caching, stricter method rules.
How many redirects can I chain together?
Browsers typically give up after about 20 hops and show an error, but Google is stricter: its documentation says Googlebot follows up to 10 redirect hops, and anything unresolved beyond that surfaces as a redirect error in Search Console. Treat more than three hops as a bug either way, since every hop adds a full network round trip for users. Audit your chains with the Redirect Checker, collapse rules so old URLs point directly at final destinations, and update internal links so they stop depending on redirects entirely.
Do short links hurt SEO because they add a redirect hop?
Not for the campaign links, posts, and emails where short links belong. Google has confirmed that 3xx redirects pass PageRank, so a short link pointing at your page passes its signals through the hop. The rule of thumb: never build your site's internal navigation on shortened URLs, because internal links should point directly at final pages, but for distribution the extra hop is precisely what buys you value. A Flyn link keeps its destination editable after publishing and records every click, and our guide on tracking link clicks shows what that data unlocks.

Ready to try Flyn?

Free plan includes 25 links/month, full analytics, and access to all 30+ free tools above. No credit card required.

Already a member? Log in

Karan Bhakuni
Karan Bhakuni· Founder, Flyn

Karan Bhakuni is the founder of Flyn. He writes about branded links, click analytics, and the link-management tooling growth teams and creators actually need, drawn from building Flyn and reading a lot of user feedback.