0

need some solution here with redirecting all of my domain (a.e mysite.co.uk, mysite.org etc) to the .com version.

My .htaccess contains the following code:

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /

 RewriteCond %{HTTPS} on [OR]
 RewriteCond %{HTTP:X-Forwarded-Proto} https [OR]
 RewriteCond %{SERVER_PORT} ^443$
 RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-l
 RewriteRule ^(.*)$ index.php/$1 [QSA,L,NC]

</IfModule>

Please help me out here

Thanks in advance

AlexB
  • 2,164
  • 6
  • 27
  • 61

1 Answers1

1

Nevermind, I think I have just found the solution:

I have added the following lines to my .htaccess

RewriteCond %{HTTP_HOST} !^(www\.)mysite\.net$ [NC]
 RewriteRule ^(.*)$ http://www.mysite.net/$1 [L,R=301]

I hope this is correct way of doing this?

AlexB
  • 2,164
  • 6
  • 27
  • 61