To redirect a domain to another domain without losing SEO, you need to set up a permanent 301 redirect in your .htaccess file or through your hosting control panel. This single configuration tells Google the content has moved for good and passes along most of the accumulated link equity.
Below you'll find the most common methods, when to use each one, and which mistakes to avoid so your domain change doesn't cost you rankings.
Why the Type of Redirect Matters
Not all redirects are equal. Using the wrong type can erase months of SEO work or create infinite loops that prevent your site from loading.
- 301 – Moved Permanently: transfers up to 99% of PageRank. Always use this when the change is permanent.
- 302 – Moved Temporarily: Google does not pass authority. Reserve it for genuinely temporary situations like maintenance or A/B testing.
- Meta refresh / JavaScript: browser-dependent; Google penalizes or ignores them. Avoid for full domain redirects.
Golden rule: if the old domain is never coming back, use a 301 without hesitation.
Method 1: 301 Redirect via .htaccess (Apache)
This is the most straightforward method if your server runs Apache — the case for most shared hosting plans. Access your cPanel file manager or FTP, open the .htaccess file in the root of the source domain, and add these lines at the top:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.old-domain\.com$
RewriteRule ^(.*)$ https://www.new-domain.com/$1 [R=301,L]
Replace old-domain.com and new-domain.com with your actual domains. The $1 variable preserves the full path, so /blog/article redirects to /blog/article on the new domain — protecting your per-URL SEO equity.
Key points about this configuration
- The
R=301flag sends the correct HTTP status code to browsers and Google. - The
Lflag marks this as the last rule, preventing other rules from interfering. - Cover both the
wwwand non-wwwversions of the source domain to leave no URLs behind.
Method 2: Redirect via cPanel / Plesk Panel
If you'd rather not edit files directly, use the built-in redirect tool in your hosting panel:
- Log in to cPanel → Redirects.
- Choose type Permanent (301).
- Under "Redirect From," select the source domain and leave the path field empty (redirect the whole domain).
- Under "Redirect To," enter the full destination URL:
https://www.new-domain.com. - Enable "Redirect with or without www" if available.
- Save.
cPanel writes the .htaccess rules automatically, producing the same result as Method 1.
Method 3: DNS-Level Redirect at Your Registrar
Some registrars offer "URL forwarding" directly in their DNS panel, with no active hosting required on the source domain. This is handy when you've already cancelled hosting for the old domain but are still paying for the registration.
| Advantage | Disadvantage |
|---|---|
| No hosting needed on the source domain | Usually doesn't preserve the full URL path |
| Very simple to configure | Some registrars use an iFrame instead of a true redirect, which hurts SEO |
| Ideal for parked domains | Less technical control than .htaccess |
If you use this option, confirm that your registrar sends a real 301, not an iFrame. Check their documentation before enabling it.
How to Verify Your Redirect Is Working
After setting it up, verify everything before notifying Google:
- Browser DevTools: press F12, open the Network tab, visit the old domain, and confirm the first response returns
301with aLocationheader pointing to the new domain. - curl in terminal:
curl -I http://old-domain.com— should showHTTP/1.1 301. - Online tool: use any "HTTP Status Checker" or "Redirect Checker" to see the full redirect chain (avoid chains longer than 2 hops).
- Google Search Console: add the new domain as a property and use the URL Inspection tool to see how Googlebot fetches it.
Key Takeaways
- Always use a 301 redirect for permanent domain changes; a 302 does not transfer SEO authority.
- The most reliable method is
.htaccesson Apache or its Nginx equivalent. - Preserve the full URL path (
$1) to maintain per-URL SEO equity. - Verify with curl or DevTools that the HTTP status is truly 301 and redirect chains are short.
- Notify Google Search Console promptly to speed up re-indexing.
- Keep the old domain active and redirecting for at least 12 months to capture traffic from external links.
Need help with a full site migration or getting your .htaccess configured correctly? The team at elenlace.com will guide you through every step so your domain change doesn't cost you a single visitor. Browse more domain guides in our domains section.
FAQ
How long does it take Google to recognize a 301 redirect?
It depends on how frequently Googlebot crawls your site. For high-authority sites it can be a matter of days; for newer or low-traffic sites it may take 2–8 weeks. Speed things up by submitting an updated sitemap in Google Search Console.
Will I lose rankings when I change domains?
A temporary dip of a few positions in the first few weeks is normal. With a properly configured 301, Google passes most of the PageRank and the site typically recovers — or even improves — within one to three months.
Can I redirect just one specific URL instead of the whole domain?
Yes. In .htaccess, use the directive Redirect 301 /old-path https://www.new-domain.com/new-path. This is useful when you're only moving a specific page, not the entire site.
What if both the source and destination domains use HTTPS?
Always point the redirect to the https:// version of the destination domain. Redirecting from HTTPS to HTTP creates a security downgrade and browsers will show warnings. Ideally, keep an active SSL certificate on both domains during the transition period.
Prefer it done for you? El Enlace handles hosting and professional web development.
Compare providers
Other providers and guides worth comparing: