What Is a Redirect?
A redirect is a server-side instruction that sends users—and search engines—from one URL to another. The most common types include 301 (permanent) and 302 (temporary) redirects, which influence how Google indexes and interprets URL moves.
301 Redirect — Permanent Move
- Definition: A 301 status code signals a permanent change. Google treats the new URL as the canonical version.
- SEO Impact: Google transfers ranking signals (PageRank) to the final URL and eventually removes the old one from its index.
- Use Cases:
- Changing domains or protocols (e.g., HTTP → HTTPS)
- Renaming or reorganizing content
- Consolidating duplicate pages
- Browser Caching: Browsers may cache these indefinitely, bypassing your server on future visits.
302 Redirect — Temporary Move
- Definition: A 302 code indicates a temporary move. Google typically keeps indexing the original URL.
- SEO Impact: Link equity is not passed; the original URL remains the primary URL in search results.
- Use Cases:
- Temporary promotions or campaigns
- A/B testing
- Site maintenance
- Caching: Generally not cached, so subsequent visits re-query your server.
Making the Right Choice
- Use 301 when the move is permanent to ensure transfer of SEO value.
- Use 302 for short-term changes to preserve the old URL’s presence.
- Avoid using server-side meta refreshes or JavaScript redirects unless absolutely necessary; Google handles meta refreshes as 301 (instant) or 302 (delayed), depending on timing.
Other Redirect Methods (According to Google)
- Meta Refresh:
- Instant (
content="0; URL"
): treated like a 301 - Delayed (
content="5; URL"
): treated like a 302
- Instant (
- JavaScript:
- Can work, but poses crawling risks—rendering may fail, and redirects might not be seen
Common Pitfalls
- Redirect chains/loops: Complex sequences (e.g., A → B → C) degrade performance and crawl efficiency. Google recommends keeping chains short.
- Incorrect redirect type: Mislabeling a permanent move as 302 can prevent proper transfer of SEO signals.
- Over-relying on JS/meta redirects: These may not be consistently recognized by Google.
Implementation Examples
Apache (.htaccess)
bashCopyEditRedirect 301 /old-page.html https://example.com/new-page.html
Nginx
nginxCopyEditlocation /old-page {
return 301 https://example.com/new-page;
}
Testing & Monitoring
Use Google Search Console to identify and resolve:
- Redirect chains and loops
- URLs wrongly indexed
- Errors in status codes
Summary Table
Situation | Best Redirect | Outcome |
---|---|---|
Permanent URL change | 301 | SEO signals transferred |
Temporary move (maintenance, testing) | 302 | Original URL stays indexed |
Meta / JavaScript fallback | Meta/JS | Used only when necessary |