Redirect a lot of old domains to only one new domain, in only 1 file

Avatar
  • Answered
Dear specialists,

I need to Redirect a lot of national domainS
(as example.net + example.de example.uk example.fr)
to only one new domain
commun domain example.com
in only 1 .htassess file since I have to do this for a lot of others domains.

May I compil the lines like this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
RewriteCond %{HTTP_HOST} ^example.net [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
RewriteCond %{HTTP_HOST} ^example.de [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
RewriteCond %{HTTP_HOST} ^example.fr [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]

???

Thanks a lot for your help !!

Best Regards
Avatar
Scott
Hello, Thank you for your redirect question. Yes, you can certainly set up the domains to redirect to your primary like that. Check out our article on 301 redirects for even more variations that you may desire. Kindest Regards, Scott M