I have two domains pointing to the same ISP hosted web site.
Both sites will load index.php. I am wondering if I can redirect requests for http://www.domain2.com (host in header) to a subfolder (/domain2/).
Please show some code snippets to do this if possible...
Thanks a lot.
Jake
Question on Redirect!!!
Moderator: General Moderators
Thatll Auto-Redirect to what u have in that script
<?PHP
header("location: http://www.domain2.com");
?>
<?PHP
header("location: http://www.domain2.com");
?>
my current host charges for this added domain feature...therefore for all requests for domain2.com, I need to redirect to a subfolder via this approach.phice wrote:If you have a decent web host, you can add more domains to the same account and have different folders for each one. You can sign up at AkiraWeb.com (my current hosts), which supports multiple domain hosting on one account.
I know how to redirect but this redirect is based on the value of host in the request header.Vicious wrote:Thatll Auto-Redirect to what u have in that script
<?PHP
header("location: http://www.domain2.com");
?>
How do I check headers[host] to see if its value is "www.domain2.com", then it is true, I can do the redirect to a subfolder.
<?PHP
header("location: /domain2/");
?>
Thanks,
J-
