Hi,
We have a domain name with various TLDs.
Let's use example.com as our main URL, and we redirect example.biz, example.net, example.org to example.com.
We had the following in .htaccess file and it worked very well:
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
You notice that any non-www will be redirected to www.
However, we just added a subdomain: str.example.com, and in order to make it accessible, we had to comment out the above rules.
I hope someone can help us to write the rules that will redirect:
- non-www and non-str to www
- non-.com TLDs to .com
Several cases to make my means clear:
- example.com -> www.example.com
- example.net -> www.example.com
- abc.example.com -> www.example.com
- str.example.com -> str.example.com
- str.example.org -> str.example.com
Thank you very much.