301 vs 302 redirect: the core difference
The difference between a 301 vs 302 redirect comes down to one word: permanence. A 301 redirect returns the HTTP status 301 Moved Permanently and tells search engines the original URL has moved for good, so they should index the destination and transfer ranking signals to it. A 302 redirect returns 302 Found (historically "Moved Temporarily") and tells engines the move is temporary, so they should keep the original URL in the index and expect it to come back.
Both redirects look identical to a human visitor — type the old URL, land on the new one — but they send opposite instructions to a crawler. A 301 says *forget the old URL and credit the new one.* A 302 says *keep the old URL; this detour is temporary.* Pick the wrong one and you either strand ranking signals on a dead page (302 used for a permanent move) or refuse to consolidate them when you should (the slow case most sites get wrong).
The practical rule for 2026 is simple: if the change is permanent, use a 301; if you genuinely plan to restore the original URL, use a 302. When in doubt, a permanent move is far more common than a temporary one, so 301 is the default for site migrations, HTTPS upgrades, URL renames, and consolidating duplicate pages.
Redirects sit inside the broader discipline of technical SEO — the crawl-and-index plumbing that decides whether engines can find and trust your pages. Getting redirect type right is one of the highest-leverage fixes on most sites, because a single misconfigured rule can quietly cap the ranking power of an entire section.
When to use a 301 vs a 302
Choosing between a 301 and a 302 is a decision about whether the original URL will ever come back. A 301 is correct whenever the answer is no; a 302 is correct only when the answer is a definite yes within a short, known window. Most real-world redirects are permanent, so 301 wins the overwhelming majority of the time.
Use a 301 permanent redirect when:
- You migrated to a new domain or merged two sites.
- You upgraded from HTTP to HTTPS or from www to non-www (or vice versa).
- You consolidated duplicate or outdated pages onto one canonical URL.
- You retired a page and want its ranking signals to flow to a relevant replacement.
Use a 302 temporary redirect when:
- You are A/B testing two versions and the original must keep its index position.
- You geo- or device-route visitors temporarily but want the canonical URL preserved.
- A seasonal page (a sale landing page) points elsewhere off-season but returns later.
- Is the move permanent?If the original URL is never coming back, you want a 301 permanent redirect.
- Will the original URL return?If you genuinely plan to restore the source URL within a known window, use a 302 temporary redirect.
- Is it a migration or HTTPS/www change?Domain moves, HTTPS upgrades, and renames are always permanent — use a 301.
- Is it maintenance, an A/B test, or seasonal routing?Temporary detours where the original must stay indexed call for a 302.
- Point to the most relevant destinationRedirect to a topically related page, not the homepage, to preserve link equity.
- Verify the status codeRun curl -I and confirm the response is 301 (or 302) and not the wrong default.
The mistake that costs the most ranking is using a 302 for what is really a permanent move. Because a 302 tells Google to keep indexing the *original* URL, the destination never fully inherits the ranking signals, and the move can underperform for months. If the old URL is never coming back, it should be a 301.
The SEO impact: link equity and indexing
The SEO impact of a 301 vs 302 redirect is the real reason the choice matters. A 301 redirect passes link equity — the ranking value of backlinks and internal links — to the destination URL and instructs Google to index the destination instead of the source. A 302 redirect keeps the original URL indexed and, by design, does *not* permanently consolidate signals onto the new URL.
On the question of how much equity a 301 passes: Google has stated for years that 301 (and other permanent) redirects pass full PageRank with no decay, so you do not lose ranking value simply by using a 301. The old advice that redirects "leak" 15% of equity is outdated. What matters is relevance — redirecting a deleted page to a *topically related* replacement preserves far more value than dumping every dead URL onto the homepage, which Google often treats as a soft 404.
For indexing, the two behave oppositely:
A 301 tells Google: drop the old URL, index the new one, move the signals over. A 302 tells Google: keep the old URL indexed, this is just a detour.
Google has also said that if a 302 stays in place long enough, it will *eventually* treat it like a 301 and pass signals — but "eventually" can mean weeks or months of underperformance you never needed to suffer. Do not rely on that fallback; set the correct status code from the start. Redirect type is closely tied to canonicalization, so pair clean redirects with a correct canonical tag on every destination URL.
How to set up a 301 redirect (with code)
Setting up a 301 redirect means configuring your server, CMS, or CDN to return the 301 status code for the old URL and a Location header pointing at the new one. The exact method depends on your stack, but every approach produces the same HTTP response. Below are the three most common configurations.
Apache (.htaccess) — redirect a single page or an entire domain:
apache
# Single page, permanent
Redirect 301 /old-page /new-page
# Whole domain to HTTPS + non-www
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]Nginx — return a 301 in a server block:
nginx
server {
listen 80;
server_name www.example.com example.com;
return 301 https://example.com$request_uri;
}
# Single path
location = /old-page {
return 301 /new-page;
}Node / Express — for app-level redirects:
js
app.get('/old-page', (req, res) => {
res.redirect(301, '/new-page'); // 301 = permanent
// res.redirect(302, '/temp') would be temporary
});After deploying any redirect, verify the status code, because frameworks and plugins default to 302 surprisingly often. Run curl -I https://example.com/old-page and confirm the response reads HTTP/2 301, not 302. You can also confirm your redirects resolve cleanly with our free SEO + GEO audit on the homepage, which flags redirect chains, wrong status codes, and broken destinations. For the full list, see all 40+ SEO/GEO checks.
Common 301 and 302 redirect mistakes
Redirect mistakes are silent — the page loads fine for visitors while Google quietly fails to pass signals, drops the wrong URL, or burns crawl budget on loops. A handful of errors account for nearly every broken redirect setup, and an audit catches them in one pass.
| Factor | 301 (Permanent) | 302 (Temporary) |
|---|---|---|
| HTTP status | 301 Moved Permanently | 302 Found (Moved Temporarily) |
| Meaning to crawlers | Old URL is gone; index the new one | Detour only; keep the old URL indexed |
| Link equity | Passes full ranking signals to the destination | Keeps signals on the original by default |
| Indexed URL | Destination URL | Original (source) URL |
| Caching | Cached aggressively by browsers | Not cached long-term |
| Use it for | Migrations, renames, HTTPS, consolidating pages | Maintenance, A/B tests, seasonal or geo routing |
The most expensive mistake is the accidental 302, because so many tools default to it. WordPress plugins, framework redirect() helpers, and load balancers frequently emit a 302 unless you explicitly request a 301. The fix is boring but essential: check the actual status code on every important redirect rather than assuming.
Two more traps worth naming. Redirect chains (A to B to C to D) dilute crawl efficiency and slow page loads — collapse them so every old URL points *directly* at its final destination in one hop. And redirecting everything to the homepage instead of a relevant page signals a soft 404 to Google, wasting the equity you were trying to preserve; send each retired URL to its closest topical match instead.
Redirects and duplicate content are two sides of the same coin. If you are consolidating overlapping pages, read how to fix duplicate content — choose a 301 when the duplicate should disappear, and a canonical when both URLs must stay live for users but only one should rank.