A domain redirect automatically sends users and search bots from one URL to another. Choosing the right redirect type is critical to preserving SEO authority.
Redirect Types
| Code | Type | SEO | When to Use |
|---|---|---|---|
| 301 | Permanent | Passes ~99% authority | Permanent domain move |
| 302 | Temporary | No authority transfer | A/B tests, temporary promos |
.htaccess Redirect Examples
# Redirect entire domain
RewriteEngine On
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
# HTTP to HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
💡 SEO tip: Pick one canonical domain version (www or non-www) and set up a 301 redirect from the other. Google should only index one version.