Redirects are the silent engineers of the web. Whether you’re moving from www to non-www, switching to HTTPS, or rebranding your domain, proper redirects decide whether your SEO authority travels with you-or disappears.
A poorly configured redirect can break indexing, split traffic, or waste valuable backlinks. This guide explains what each redirect type means, when to use it, and how to implement them the right way.
What Is a Redirect?
A redirect tells browsers and search engines that a URL has moved. When a user visits the old URL, the server responds with a 3xx HTTP status code and forwards them to the new location.
Common Use Cases
- Domain migrations (e.g.,
example.net→example.com) - HTTPS upgrades (
http://→https://) - Canonical version control (
www↔non-www) - Content restructuring or page merges
Without redirects, visitors hit 404s, and search engines lose trust.
Understanding 301 vs 302 Redirects
301 Redirect – Permanent Move
- Signals that the old URL is gone for good.
- Passes ≈ 90–99 % of link equity (PageRank).
- Updates index to the new destination.
- Cached by browsers and search engines.
Use for:
- Domain migrations
- HTTPS enforcement
- Canonical consolidation
- Permanent URL changes
302 Redirect – Temporary Move
- Indicates a short-term change.
- Does not transfer full SEO authority.
- Search engines keep the original URL indexed.
- Useful for A/B testing, maintenance, or location-based routing.
Use for:
- Limited-time campaigns
- Staging or beta pages
- Seasonal offers
SEO Impact Summary
| Factor | 301 (Permanent) | 302 (Temporary) |
|---|---|---|
| Link Equity Transfer | ✅ Full | ⚠️ Partial / None |
| Index Update | ✅ New URL | ⚠️ Old URL retained |
| Caching by Browsers | ✅ Yes | ⚠️ Limited |
| Ideal For | Migrations & HTTPS | Testing & Short-Term Moves |
How to Set Up a 301 Redirect
Implementation depends on your server environment.
1 – Apache (.htaccess)
RewriteEngine On
# Redirect www to non-www
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]
2 – Nginx
server {
listen 80;
server_name www.example.com;
return 301 https://example.com$request_uri;
}
3 – WordPress / CMS
Use the “Site Address” and “Home URL” settings or a plugin like Redirection for page-specific rules.
4 – Cloudflare / CDN
Create a Page Rule → www.example.com/* → https://example.com/$1 (status: 301)
How to Set Up a 302 Redirect
Apache
Redirect 302 /old-offer https://example.com/new-offer
Nginx
rewrite ^/old-offer$ https://example.com/new-offer redirect;
Testing Your Redirects
- Browser Test: Visit the old URL; confirm auto-forward to the new one.
- Command Line:
curl -I https://oldurl.com→ checkHTTP/1.1 301 Moved Permanently. - Crawlers: Run Screaming Frog or Sitebulb to ensure no redirect chains (>1 hop).
- Google Search Console: Inspect the new URL → “URL is on Google.”
A single-hop 301 redirect is best for speed and authority.
Avoiding Redirect Mistakes
| Mistake | Effect | Fix |
|---|---|---|
| Using 302 for permanent moves | Link equity lost | Replace with 301 |
| Chain redirects (>2 steps) | Crawl inefficiency | Consolidate rules |
| 302 + HTTPS mismatch | Duplicate indexing | Merge to one 301 |
| Redirect loop | Site inaccessible | Test configs with curl -I -v |
| No canonical tag | Mixed signals | Add canonical to final URL |
301 Redirects and Analytics Data
Because 301s are cached, they preserve referral and campaign data accurately across platforms.
302s can break tracking sessions, causing analytics drops. For SEO and reporting integrity, 301 is preferred for permanent migrations.
HTTP to HTTPS Redirect
Modern browsers flag non-HTTPS sites as insecure. Redirect all HTTP traffic to HTTPS using 301:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]
Benefits:
- SEO Boost (Google ranking signal)
- User Trust (lock icon)
- Analytics Integrity (referrer data preserved)

