same contents, two domains with different index files

Using a single web hosting account to host multiple sites

same contents, two domains with different index files

Postby ienfant » Tue Apr 28, 2009 4:36 pm

Hi.

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
ienfant
 
Posts: 1
Joined: Tue Apr 21, 2009 9:27 am

Postby richardk » Thu Apr 30, 2009 12:52 pm

R=301 causes a visible redirect
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?company\.com$ [NC]
RewriteRule ^/$ /company.html [QSA,L]

RewriteCond %{HTTP_HOST} ^(www\.)?mall\.com$ [NC]
RewriteRule ^/$ /mall.html [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 1 guest

cron