I've an account of a sharing server with two domains: company.com and mall.com
I wanted match different index file on each domain: company.com - company.html, mall.com - mall.html
- Code: Select all
RewriteCond %{HTTP_HOST} ^(www\.)?company\.com$ [NC]
RewriteRule ^/$ http://www.company.com/company.html [L,R=301]
RewriteCond %{HTTP_HOST} ^(www\.)?mall\.com$ [NC]
RewriteRule ^/$ http://www.mall.com/mall.html [L,R=301]
It worked, but when I access to company.com, the full address is exposed in the address bar: http://www.company.com/company.html mall.com also.
I wonder there is other solutions that only to expose domain addresses, not to expose full pathes: company.com -> http://www.company.com