waytech2003
Programmer
I am very new to PHP so I do not know how to do what I need, or for that matter, if it can be done.
I have several sites hosted on a server that I have an account with. I have an index.php file in the root directory as shown below.
===========================================================
<?
if (substr_count ($_SERVER['HTTP_HOST'],"abc")!=0):
header("Location: [COLOR=red yellow]AAA[/color]/index.html");
elseif (substr_count ($_SERVER['HTTP_HOST'],"efg")!=0):
header("Location: [COLOR=red yellow]BBB[/color]/index.html");
elseif (substr_count ($_SERVER['HTTP_HOST'],"xyz")!=0):
header("Location: [COLOR=red yellow]CCC[/color]/index.html");
else:
header("Location:
endif;
?>
===========================================================
As you can see I am sending them to a sub directory, depending on how there got here.
If they typed then they will get the page at www.abc.org/[COLOR=red yellow]AAA[/color]/index.html
If they typed then they will get the page at www.efg.org/[COLOR=red yellow]BBB[/color]/index.html
If they type I want them to get www.abc.org/[COLOR=red yellow]AAA[/color]/test.htm
How can I put them in the right sub directory, and give them the page they need?
I have several sites hosted on a server that I have an account with. I have an index.php file in the root directory as shown below.
===========================================================
<?
if (substr_count ($_SERVER['HTTP_HOST'],"abc")!=0):
header("Location: [COLOR=red yellow]AAA[/color]/index.html");
elseif (substr_count ($_SERVER['HTTP_HOST'],"efg")!=0):
header("Location: [COLOR=red yellow]BBB[/color]/index.html");
elseif (substr_count ($_SERVER['HTTP_HOST'],"xyz")!=0):
header("Location: [COLOR=red yellow]CCC[/color]/index.html");
else:
header("Location:
endif;
?>
===========================================================
As you can see I am sending them to a sub directory, depending on how there got here.
If they typed then they will get the page at www.abc.org/[COLOR=red yellow]AAA[/color]/index.html
If they typed then they will get the page at www.efg.org/[COLOR=red yellow]BBB[/color]/index.html
If they type I want them to get www.abc.org/[COLOR=red yellow]AAA[/color]/test.htm
How can I put them in the right sub directory, and give them the page they need?