301 vs 302 Redirects: When to Use Each Type
5 min read
301 vs 302 Redirects: When to Use Each Type
Reading time: 5 minutes
TLDR
Use 301 redirects for permanent moves. They pass 90-99% of link equity and tell Google to index the new URL. Use 302 redirects for temporary moves like A/B tests or seasonal pages. They keep the old URL indexed and pass little link equity. Common mistake: using a 302 for a permanent move means the new page never gains rankings. Implement redirects in your .htaccess file, nginx config, or WordPress plugin. Test with a redirect checker to verify the status code.
Quick Definition: Redirects send users (and search engines) from one URL to another. A 301 says “this page moved permanently. update your bookmarks.” A 302 says “this page moved temporarily. keep the old URL.”
Choosing the wrong redirect type can tank your rankings. Here’s how to get it right.
The Critical Difference
| 301 (Permanent) | 302 (Temporary) |
|---|---|
| Passes 90-99% of link equity | Passes little to no link equity |
| Google indexes the NEW URL | Google keeps indexing the OLD URL |
| Old URL disappears from search results | Old URL stays in search results |
| Use when content moved forever | Use when content will return |
SEO Impact:
- 301 redirects transfer almost all “SEO juice” (rankings, backlinks, authority) to the new URL
- 302 redirects keep the SEO value on the original URL (because Google expects it to come back)
Common mistake: Using a 302 for a permanent move. Result: The new page never gains rankings because Google thinks the old URL will return.
When to Use 301 (Permanent Redirect)
1. Site Migrations
Moving from oldsite.com to newsite.com:
oldsite.com → 301 → newsite.com
2. URL Structure Changes
Changing your URL format:
example.com/products.php?id=123 → 301 → example.com/products/widget-name
3. Content Consolidation
Merging duplicate pages:
example.com/seo-tips → 301 → example.com/blog/complete-seo-guide
example.com/seo-guide → 301 → example.com/blog/complete-seo-guide
4. HTTP to HTTPS Migration
http://example.com → 301 → https://example.com
5. Removing Old Products/Pages
Product discontinued? Redirect to category page or replacement:
example.com/products/old-model → 301 → example.com/products/new-model
6. Fixing WWW vs Non-WWW
Pick one version and redirect the other:
example.com → 301 → www.example.com
OR
www.example.com → 301 → example.com
When to Use 302 (Temporary Redirect)
1. A/B Testing Pages
Testing a redesign before committing:
example.com/landing → 302 → example.com/landing-v2
(Use 302 so the original URL keeps its rankings during the test)
2. Seasonal Content
Summer sale page redirects to homepage after promotion ends:
example.com/summer-sale → 302 → example.com
(In 11 months, you’ll bring back /summer-sale for next year)
3. Maintenance Mode
Site under maintenance:
example.com → 302 → example.com/maintenance.html
4. Regional/Language Redirects
Redirecting based on user location (but keeping all URL versions indexed):
example.com → 302 → example.com/uk (for UK visitors)
example.com → 302 → example.com/us (for US visitors)
5. Out-of-Stock Products
Product temporarily unavailable:
example.com/product/blue-widget → 302 → example.com/product/blue-widget?out-of-stock=true
Key principle: Only use 302 if the original URL will be restored within weeks/months.
How to Implement Redirects
Apache (.htaccess)
301 Redirect:
# Single page redirect
Redirect 301 /old-page.html https://example.com/new-page.html
# Entire domain redirect
RewriteEngine On
RewriteCond %{HTTP_HOST} ^oldsite\.com$ [NC]
RewriteRule ^(.*)$ https://newsite.com/$1 [R=301,L]
# HTTP to HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
302 Redirect:
Redirect 302 /temporary-page.html https://example.com/new-location.html
Nginx
301 Redirect:
# Single page
location = /old-page {
return 301 https://example.com/new-page;
}
# Entire domain
server {
server_name oldsite.com;
return 301 https://newsite.com$request_uri;
}
302 Redirect:
location = /temporary-page {
return 302 https://example.com/new-location;
}
WordPress
Use a plugin like Redirection or Yoast SEO Premium:
- Install plugin
- Add source URL:
/old-page - Add target URL:
/new-page - Select “301 Permanent” or “302 Temporary”
- Save
PHP
// 301 Permanent
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://example.com/new-page");
exit();
// 302 Temporary
header("HTTP/1.1 302 Found");
header("Location: https://example.com/temporary-page");
exit();
JavaScript (Not Recommended for SEO)
// Only use if server-side redirects aren't possible
window.location.href = "https://example.com/new-page";
Warning: Search engines may not follow JavaScript redirects. Use server-side redirects whenever possible.
Common Redirect Mistakes
Redirect Chains
Problem:
Page A → 301 → Page B → 301 → Page C
Why bad:
- Each redirect loses some link equity
- Slower page load times
- Google may stop following after 3-5 hops
Fix: Always redirect straight to the final destination:
Page A → 301 → Page C
Page B → 301 → Page C
Redirect Loops
Problem:
Page A → 301 → Page B → 301 → Page A
Result: Browser shows “Too many redirects” error.
Fix: Test redirects before deploying. Use Redirect Checker.
Redirecting to Irrelevant Pages
Bad:
example.com/plumbing-services → 301 → example.com/homepage
Better:
example.com/plumbing-services → 301 → example.com/services
Best:
example.com/plumbing-services → 301 → example.com/services/plumbing
Google expects redirects to lead to relevant content. Redirecting everything to the homepage wastes link equity.
Using 302 for Permanent Moves
Scenario: You migrate from /blog/old-url to /blog/new-url and use a 302.
Result after 6 months:
- Google still indexes
/blog/old-url /blog/new-urlhas no rankings- You’ve lost 6 months of SEO value
Fix: Change the 302 to 301 immediately.
Checking Your Redirects
Browser Developer Tools
- Open Dev Tools (F12)
- Go to Network tab
- Load your URL
- Check the Status Code column for “301” or “302”
Online Tools
- Redirect Checker
- HTTP Status Code Checker
- Screaming Frog SEO Spider (for bulk checking)
Google Search Console
- Coverage Report → “Page with redirect” shows URLs with redirects
- Check if old URLs are still indexed (sign of improper redirect)
Other Redirect Types (Advanced)
| Code | Name | When to Use |
|---|---|---|
| 307 | Temporary (HTTP/1.1) | Same as 302 but preserves POST data |
| 308 | Permanent (HTTP/1.1) | Same as 301 but preserves POST data |
| Meta Refresh | Client-side redirect | Last resort (not recommended for SEO) |
For 99% of cases, stick with 301 and 302.
Quick Decision Tree
Is this change permanent?
- Yes → Use 301
- No → Continue below
Will the old URL come back within 3-6 months?
- Yes → Use 302
- No → Use 301
Still unsure? Default to 301. You can always change a 301 to 302 later if needed, but delaying a 301 costs you SEO value.
What Surmado Checks
Surmado Scan looks for:
- Redirect chains (flags 3+ redirects in a row)
- Redirect loops (flags infinite redirects)
- 302 redirects older than 6 months (suggests using 301)
- HTTP→HTTPS redirects (should be 301, not 302)
→ Related: Canonical URLs: Fix Duplicate Content | Server Response Codes
Next Steps
Was this helpful?
Thanks for your feedback!
Have suggestions for improvement?
Tell us moreHelp Us Improve This Article
Know a better way to explain this? Have a real-world example or tip to share?
Contribute and earn credits:
- Submit: Get $25 credit (Signal, Scan, or Solutions)
- If accepted: Get an additional $25 credit ($50 total)
- Plus: Byline credit on this article