Redirect from .net to .com using htaccess.?

Ben Olsen

New member
Does anybody know how to redirect a site that ends in .net to a site that ends in .com

So for example google indexed:

www.mywebsite.net/content/35 but it should be redirected to www.mywebsite.com/content/35
the number 35 is dynamic, so it could also say www.mywebsite.net/content/299 that should be redirected to
www.mywebsite.com/content/299

so in put this rule in my htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} \.net$
RewriteRule ^(.*)$ http://mywebsite.com/$1 [R=301,L]

And that did not work. I don't use the .net version of the site at all, I just parked it there in case. I also came along this code but I don't know to modify for me.

RewriteEngine On
RewriteCond %{REQUEST_URI} !=/index.php
RewriteRule .* /index.php
Any Help is appreciated.
 
Back
Top