frozenpeas
Technical User
Hi,
I have 3 domain names that point to my hosting provider. I would like to serve 3 different sites, while keeping the the url as 'normal' as possible.
I am using this right now:
This is okay but if you go to the url becomes This causes problems for me as I cannot access the site root as /images/spacer.gif... I now have to call /domain2/images/spacer.gif
Is there a better way to split up the 3 domains than what I am doing?
Thanks. frozenpeas
I have 3 domain names that point to my hosting provider. I would like to serve 3 different sites, while keeping the the url as 'normal' as possible.
I am using this right now:
Code:
<?
$refer = $HTTP_HOST;
// note: domain.com, [URL unfurl="true"]www.domain.com,[/URL] domain.net, [URL unfurl="true"]www.domain.net[/URL] will match
if (eregi("[URL unfurl="true"]www.domain1.com",[/URL] $refer)) { header ("Location: ./domain1/"); }
elseif (eregi("[URL unfurl="true"]www.domain2.com",[/URL] $refer)) { header ("Location: ./domain2/");}
elseif (eregi("[URL unfurl="true"]www.domain3.ca",[/URL] $refer)) { header ("Location: ./domain3/");}
?>
This is okay but if you go to the url becomes This causes problems for me as I cannot access the site root as /images/spacer.gif... I now have to call /domain2/images/spacer.gif
Is there a better way to split up the 3 domains than what I am doing?
Thanks. frozenpeas