Redirects
Redirects are HTTP status codes that tell browsers and search engines that a URL has been moved to a new address. They are essential for SEO-safe website migrations, URL changes, and maintaining link power.
What are Redirects?
Redirects are HTTP status codes that tell browsers and search engines that a URL has been moved to a new address. They are essential for SEO-safe website migrations, URL changes, and maintaining link power.
Redirect Types in Detail
301 Redirects (Permanent)
301 redirects signal to search engines that a URL has been permanently moved to a new address. They transfer 99% of link power and are the gold standard for SEO migrations.
Use Cases:
- Domain moves
- URL structure changes
- Content migrations
- HTTPS implementation
302 Redirects (Temporary)
302 redirects indicate that a URL has been temporarily moved to another address. They transfer no link power and should only be used for short-term redirects.
Use Cases:
- A/B testing
- Maintenance work
- Temporary landing pages
307 and 308 Redirects
- 307: Temporary, preserves HTTP method
- 308: Permanent, preserves HTTP method
Redirect Mapping Strategies
1. 1:1 Mapping
Each old URL is mapped exactly to one new URL. This is the cleanest method, but not always practical.
Advantages:
- Clear structure
- Easy tracking
- Maximum SEO control
2. Category Mapping
Multiple similar URLs are consolidated into a category page.
Example:
/old-product-1/ → /products/category-a/
/old-product-2/ → /products/category-a/
/old-product-3/ → /products/category-b/
3. Wildcard Mapping
Dynamic URLs are redirected using patterns.
Example:
/blog/* → /articles/*
/shop/category/* → /products/*/category/*
Avoiding Redirect Chains
Redirect chains occur when a redirect points to another redirect. This can lead to performance issues and link power losses.
Common Chain Scenarios
- A → B → C: Old URL redirects to intermediate URL, which in turn redirects to final URL
- Meta-Refresh Chains: Multiple meta-refresh tags in sequence
- JavaScript Chains: Multiple JavaScript redirects
Chain Detection Methods
Server Configuration
Apache (.htaccess)
# 301 Redirect
Redirect 301 /old-page/ /new-page/
# 302 Redirect
Redirect 302 /temporary/ /maintenance/
# Wildcard Redirect
RedirectMatch 301 ^/blog/(.*)$ /articles/$1
# Domain Redirect
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
Nginx
# 301 Redirect
location /old-page/ {
return 301 /new-page/;
}
# Domain Redirect
server {
server_name olddomain.com;
return 301 https://newdomain.com$request_uri;
}
PHP Redirects
<?php
// 301 Redirect
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://example.com/new-page/");
exit();
?>
Warning: Avoid meta-refresh for SEO-critical redirects. They are not recognized by search engines as real redirects.
Testing and Validation
1. Check HTTP Status Code
curl -I https://example.com/old-page/
# Expected: HTTP/1.1 301 Moved Permanently
2. Validate Final URL
curl -L https://example.com/old-page/
# Should redirect to correct target URL
3. Test Link Power Transfer
- Google Search Console: Check Coverage Report
- Ahrefs/SEMrush: Monitor backlink transfer
- Run PageRank simulations
Common Redirect Errors
1. Wrong Status Codes
- 302 instead of 301 for permanent moves
- 200 instead of 301 for URL changes
- Missing status codes
2. Redirect Loops
- A → B → A circle
- Wildcard conflicts
- Server configuration errors
3. Lost Parameters
- UTM parameters are lost
- Session IDs are not transferred
- Query strings are truncated
4. Mobile vs Desktop Inconsistencies
- Different redirects for different user agents
- Responsive design problems
- Touch vs desktop URLs
Monitoring and Maintenance
1. Google Search Console
- Coverage Report for redirect errors
- URL Inspection Tool for individual tests
- Performance monitoring for target URLs
2. Analyze Server Logs
- 404 errors after redirect implementation
- Crawl budget optimization
- User-agent specific problems
3. Backlink Monitoring
- Ahrefs/SEMrush for link transfer
- Identify lost backlinks
- New backlinks on target URLs
Best Practices for SEO-Safe Redirects
1. Planning
- Create complete URL list
- Prefer 1:1 mapping
- Use wildcards sparingly
2. Implementation
- 301 for permanent changes
- Avoid chains
- Prefer server-level redirects
3. Testing
- Test all redirects manually
- Use automated tools
- Check mobile and desktop
4. Monitoring
- Monitor GSC regularly
- Minimize 404 errors
- Keep an eye on performance
Important: Redirects are not a one-time task. Regular monitoring and adjustments are essential for long-term SEO success.