301 Redirect
What is a 301 Redirect?
A 301 Redirect is the internet's "Change of Address" form. It tells browsers and search engines: "This page doesn't live here anymore; it moved to this address permanently. Please update your bookmarks and indexes."
Why it Matters for SEO
1. Preserves Link Equity (Juice)
This is the most critical function. If reputable sites link to your old URL, and you simply delete it (404) or use a temporary redirect (302), you lose 100% of that backlink value. A 301 redirect passes ~95-99% of that authority to the new page.
2. Maintains Rankings
If you migrate from http to https, or change your domain, 301 redirects ensure you don't lose your hard-earned keyword rankings.
3. Better User Experience
It prevents users from landing on "Page Not Found" errors when clicking old links from bookmarks or social media.
301 vs. 302 Redirects
- 301 (Moved Permanently): "I have moved and I'm never coming back." Use for SEO.
- 302 (Found / Temporary): "I'm visiting another address for a week, but keep my old house listed." Do not use unless the change is truly temporary (e.g., A/B testing or site maintenance). 302s do not typically pass ranking authority.
Code Implementation
Nginx:
location /old-page {
return 301 /new-page;
}Apache (.htaccess):
Redirect 301 /old-page /new-pageNext.js (next.config.js):
async redirects() {
return [
{
source: '/old-page',
destination: '/new-page',
permanent: true, // This makes it a 301
},
]
}Common Pitfalls
Redirect Chains
The Problem: Page A -> 301 -> Page B -> 301 -> Page C.
The Impact: This slows down page load speed (bad for users/LCP) and dilutes link equity. Google stops following after about 5 hops.
The Fix: Update Page A to redirect directly to Page C.
Redirect Loops
The Problem: Page A -> 301 -> Page B -> 301 -> Page A.
The Impact: The site crashes for the user ("Too many redirects").
Redirecting to Irrelevant Content
The Problem: Deleting a blog post about "SEO" and redirecting it to the "Home" page.
The Impact: Google treats this as a "Soft 404" because the content doesn't match. You lose the ranking anyway. Only redirect to relevant, replacement content.