Hey, I have a domain mydomain.net and mydomain.com. I want to use mydomain.com and redirect www.mydomain.net and mydomain.net to mydomain.com What is the best way to accomplish that with the .htaccess file? Thanks!
Redirect 301 / http://mydomain.com/ Code (markup): Put this in htaccess, thats it. or to redirect everything from that domain to new one Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://mydomain.com/$1 [R=301,L] Code (markup):
Hey, When I add your code I receive an error message (infinity loop). I added instead: RewriteCond %{HTTP_HOST} ^www.mydomain\.net$ RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301] RewriteCond %{HTTP_HOST} ^mydomain\.net$ RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301] Thats works also, but I thought that there is maybe a more elegant solution... Thanks!