Redirect (301 / 302)
A redirect is a server response that automatically sends users and search engines from one URL to another, with 301 (permanent) and 302 (temporary) redirects having different SEO implications for link equity transfer.
What is Redirect (301 / 302)?
Redirects are HTTP responses that tell browsers and search engines a URL has moved. The two most important redirect types are 301 (Moved Permanently) and 302 (Found). A 301 redirect indicates a page has permanently moved and passes link equity and ranking power from the old URL to the new URL. A 302 redirect indicates a temporary move and historically didn't pass link equity as effectively, though modern Google treats 302s more like 301s in some contexts. Implementing redirects correctly is essential when restructuring websites, consolidating pages, or migrating domains.
Implementing 301 redirects is critical during website restructures because they preserve SEO value from old URLs. Without proper redirects, old URLs return 404 errors, search engines gradually deindex them, and any link equity pointing to those URLs is lost. With 301 redirects, users and search engines are seamlessly directed to the new URL, link equity transfers, and rankings follow. This makes strategic use of 301 redirects one of the most important technical SEO practices when changing URL structure. Historically, Google officially stated 301 redirects pass 'some' link juice, but modern testing suggests nearly all link equity transfers through properly implemented 301 redirects.
Different redirect implementation methods exist depending on your server environment. .htaccess files (Apache servers) use RewriteRule for redirects. Nginx servers require different syntax. PHP applications handle redirects in code. CDNs and WordPress use their own redirect systems. Despite implementation differences, the core principle remains: ensure redirects are properly implemented, avoid redirect chains, and map related content to meaningful destinations rather than redirecting everything to the homepage. Additionally, verify redirects work correctly through tools testing that the final destination resolves without errors.
Meta refresh and JavaScript redirects are weaker alternatives that search engines handle differently. Meta refresh requires HTML parsing before redirect execution, slowing user experience. JavaScript redirects depend on JavaScript execution, which search engines may not follow. Server-side redirects (301/302) execute immediately before page content loads, making them the preferred technical solution. While meta refresh has limited SEO applications, it remains useful for specific scenarios where server-side redirects aren't available.
Why It Matters for SEO
Properly implemented redirects are essential for preserving SEO value during website changes. A site restructure without proper redirects can eliminate years of accumulated SEO authority, causing drastic traffic drops. Conversely, proper redirect implementation allows sites to restructure URL patterns, consolidate duplicate content, or migrate to new domains while retaining ranking positions and traffic. For large sites undergoing restructure, proper redirect implementation can mean the difference between maintaining traffic or losing 80%+ of organic search revenue.
Redirects also enable user experience improvements like removing unnecessary URL parameters, shortening URLs, or updating URL slugs without disrupting search visibility. This flexibility allows sites to evolve URL structure and branding without permanent SEO consequences, making redirects essential infrastructure for sustainable site optimization.
Examples & Code Snippets
301 Redirect in .htaccess
# Single URL redirect
Redirect 301 /old-page /new-page
# Redirect entire subdirectory
Redirect 301 /old-folder/ /new-folder/
# Using RewriteRule (more flexible)
RewriteEngine On
RewriteRule ^old-page/?$ /new-page [L,R=301]
# Redirect with query parameters
RewriteEngine On
RewriteCond %{QUERY_STRING} ^id=123$
RewriteRule ^product/$ /products/new-product/? [L,R=301]Apache .htaccess syntax for 301 permanent redirects. Redirect directive works for simple cases. RewriteRule handles complex patterns. Query string removal (?] clears parameters.
302 Temporary Redirect
# .htaccess 302 redirect (temporary)
Redirect 302 /seasonal-page /summer-deals-2026
# RewriteRule 302 redirect
RewriteRule ^maintenance/?$ /temporarily-closed [L,R=302]
# PHP header() method
header('Location: /new-url', true, 302);302 redirects indicate temporary moves. Use for seasonal content, temporary maintenance pages, or A/B testing where you want to preserve original URL's ranking power.
Meta Refresh Redirect
<!-- Meta refresh: Weak alternative to 301/302 redirects -->
<meta http-equiv="refresh" content="0; url=/new-url">
<!-- With delay (useful for user notification) -->
<meta http-equiv="refresh" content="5; url=/moved-location">
<p>This page has moved. Redirecting to new location...</p>Meta refresh executes client-side after HTML loads. Slower than server redirects. Useful when server-side redirects unavailable, but inferior for SEO. Add delay for user messaging.
Use 301 redirects for permanent changes and verify all redirects resolve to valid final destinations without redirect chains; map related content to similar new URLs rather than redirecting everything to the homepage to preserve contextual relevance.
Frequently Asked Questions
Ready to Grow Your Organic Traffic?
Get a free SEO audit and a custom strategy roadmap for your business. No commitment required — just results-focused recommendations from our team.