redirect code - multiple domain names
Posted: Tue Jul 13, 2010 7:12 pm
Hi,
I am fluent in ASP but very limited in PHP!
I have one account (http://www.domainone.com.au) with three domain aliases and on the root index.php page - I would like the domain name to be detected and redirected to a specific page with the correct domain name in the title bar. (The domains used are just examples.)
Can anyone provide help or any ideas? Thanks!
Here is the proposed index.php code:
<?
$aa = 'www.domainone.com.au';
$bb = 'www.domainone.com';
$cc = 'www.domaintwo.com.au';
$dd = 'www.domainthree.com.au';
$url = $_SERVER['SERVER_NAME'];
if ($url = $aa)
{
header('Location: http://www.domainone.com.au/folderone/index.php');
}
else
if ($url = $bb)
{
header('Location: http://www.domainone.com/folderone/index.php');
}
else
if ($url = $cc)
{
header('Location: http://www.domaintwo.com.au/foldertwo/index.php');
}
else
if ($url = $dd)
{
header('Location: http://www.domainthree.com.au/folderthree/index.php');
}
?>
I am fluent in ASP but very limited in PHP!
I have one account (http://www.domainone.com.au) with three domain aliases and on the root index.php page - I would like the domain name to be detected and redirected to a specific page with the correct domain name in the title bar. (The domains used are just examples.)
Can anyone provide help or any ideas? Thanks!
Here is the proposed index.php code:
<?
$aa = 'www.domainone.com.au';
$bb = 'www.domainone.com';
$cc = 'www.domaintwo.com.au';
$dd = 'www.domainthree.com.au';
$url = $_SERVER['SERVER_NAME'];
if ($url = $aa)
{
header('Location: http://www.domainone.com.au/folderone/index.php');
}
else
if ($url = $bb)
{
header('Location: http://www.domainone.com/folderone/index.php');
}
else
if ($url = $cc)
{
header('Location: http://www.domaintwo.com.au/foldertwo/index.php');
}
else
if ($url = $dd)
{
header('Location: http://www.domainthree.com.au/folderthree/index.php');
}
?>