301 vs 302 Redirects: A Complete Guide
Master the difference between permanent and temporary redirects to protect your SEO rankings and guide users effectively.
What Are HTTP Redirects?
HTTP redirects are status codes that tell browsers and search engines to go to a different URL than the one originally requested. They're essential for:
- Moving content to new URLs during site redesigns
- Consolidating duplicate pages
- Handling temporary maintenance
- Forwarding old domains to new ones
The two most common redirect types are 301 (Permanent) and 302 (Temporary). Choosing the wrong one can significantly impact your SEO.
301 Redirect: Permanent Move
A 301 redirect tells search engines that a page has permanently moved to a new location. This is the most common redirect type and should be your default choice for most situations.
SEO Impact of 301 Redirects
- Passes link equity - Most of the SEO value from backlinks transfers to the new URL
- Updates search index - Google replaces the old URL with the new one in search results
- Preserves rankings - When done correctly, rankings migrate to the new URL
When to Use 301 Redirects
- Site migrations to a new domain
- Changing URL structure permanently
- Consolidating multiple pages into one
- Removing old content that has a better replacement
- Switching from HTTP to HTTPS
302 Redirect: Temporary Move
A 302 redirect indicates a temporary move. It tells search engines to keep the original URL indexed because the page will return.
Common Mistake
Many developers accidentally use 302 redirects when they should use 301s. This can prevent link equity from transferring and cause indexing issues.
When to Use 302 Redirects
- A/B testing different page versions
- Temporary promotions or seasonal content
- Site maintenance (though 503 is often better)
- Geolocation-based redirects
- When you plan to bring the original URL back
301 vs 302: Quick Comparison
| Feature | 301 (Permanent) | 302 (Temporary) |
|---|---|---|
| Link Equity | Passes to new URL | Stays with original URL |
| Indexed URL | New URL replaces old | Original URL stays indexed |
| Browser Caching | Cached permanently | Not cached (checked each time) |
| Use Case | Permanent changes | Temporary situations |
How to Implement Redirects
Apache (.htaccess)
# 301 Permanent Redirect
Redirect 301 /old-page.html https://example.com/new-page.html
# 302 Temporary Redirect
Redirect 302 /promo.html https://example.com/sale.html
Nginx
# 301 Permanent Redirect
rewrite ^/old-page.html$ https://example.com/new-page.html permanent;
# 302 Temporary Redirect
rewrite ^/promo.html$ https://example.com/sale.html redirect;
JavaScript (Client-side - Not Recommended for SEO)
// Only use if server-side redirect isn't possible
window.location.replace("https://example.com/new-page.html");
How to Check Your Redirects
After implementing redirects, verify they're working correctly. Common issues include:
- Redirect chains - Multiple redirects in a row (A → B → C)
- Redirect loops - Pages that redirect to each other
- Wrong redirect type - Using 302 instead of 301
Test Your Redirects
Use URL Status Checker to verify your redirects are working correctly. It shows the exact status code (301, 302, etc.) and final destination for each URL.
Check Redirect ChainsOther Redirect Status Codes
While 301 and 302 are the most common, there are other redirect codes:
- 303 See Other - Used after form submissions
- 307 Temporary Redirect - Like 302, but preserves the HTTP method
- 308 Permanent Redirect - Like 301, but preserves the HTTP method
For SEO purposes, 301 and 302 cover the vast majority of use cases.
Best Practices for Redirect SEO
- Use 301 by default - Only use 302 when the move is truly temporary
- Avoid redirect chains - Each hop loses a small amount of link equity
- Update internal links - Point directly to the new URL when possible
- Keep redirects indefinitely - Don't remove 301s after a few months
- Redirect to relevant content - Don't redirect everything to the homepage
Verify Your Redirects Are Working
Check up to 100 URLs at once and see exactly which status code each one returns.
Test Your Redirects Free