TL;DR: 301 = Permanent redirect, passes authority fully. 302 = Temporary redirect, doesn't pass authority (mostly). Use 301 for permanent changes, 302 only for actual temporary needs.
The Difference
301. Permanent
- Old URL replaced permanently.
- Google transfers authority to new URL.
- Old URL eventually removed from index.
- Use for: domain changes, URL restructure, content migration.
302. Temporary
- Old URL redirected temporarily.
- Google keeps old URL in index.
- Authority stays on old URL.
- Use for: A/B testing, seasonal content, maintenance mode.
Common Mistake
Using 302 when 301 is intended. Old URL stays indexed. New URL doesn't gain authority. SEO value lost.
How to Set
Apache (.htaccess)
Redirect 301 /old-page /new-page
Redirect 302 /seasonal /promotionNginx
rewrite ^/old-page$ /new-page permanent;
rewrite ^/seasonal$ /promotion redirect;PHP / WordPress
header("Location: /new-page", true, 301);
// OR
header("Location: /seasonal", true, 302);Testing
Use Redirect Checker tool. Or curl:
curl -I https://example.com/old-pageLook for "301 Moved Permanently" or "302 Found".
Redirect Chains
A → B → C. avoid. Google loses authority each hop.
Fix: A → C directly.