If I have these dummy domain names example1.com and example1.net available. I want to redirect them as below using .htaccess file and mod_rewrite module:
example1.com -> www.example1.com
example1.net -> www.example1.com
www.example1.net -> www.example1.com
I have achieved the first task which is this:
RewriteEngine on
RewriteCond %{HTTP_HOST} example1\.com [NC]
RewriteCond %{HTTP_HOST} !^www\.example1\.com [NC]
RewriteRule ^(.*) http://www.example1\.com/$1 [L,R=301]
What about the rest?
I was able to do it myself. Don’t know how well the rules are written:
Please correct or suggest a better answer