Redirects tell browsers and search engines that a page has moved to a new location. Using the right redirect type is crucial for preserving SEO value and providing a good user experience.
The page has permanently moved to a new location.
The page has temporarily moved; will return.
| Code | Name | SEO Impact | Use Case |
|---|---|---|---|
301 |
Moved Permanently | Passes link equity | Permanent moves |
302 |
Found (Temporary) | Keeps original indexed | Temporary moves |
307 |
Temporary Redirect | Like 302 | HTTP to HTTPS temp |
308 |
Permanent Redirect | Like 301 | Permanent (preserves method) |
Meta Refresh |
HTML-based | Avoid | Only if no server access |
JavaScript |
JS-based | Avoid | Only as last resort |
# Single page redirect
Redirect 301 /old-page.html /new-page.html
# Entire domain redirect
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
# HTTP to HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Single page redirect
location = /old-page {
return 301 /new-page;
}
# HTTP to HTTPS
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri;
}
/page-a → /page-b → /page-c → /page-d
Each hop loses link equity and slows down the user. Fix by redirecting directly to the final destination.
/page-a → /page-d/page-b → /page-d/page-c → /page-d
All pages redirect directly to the final URL.