en basitinden böyle bir kod işini görül heralde

aşağıdaki kod index.php dosyasının içine koyman yeterli olur.
$domain_a="siteA.com";
$domain_b="siteB.com";
if(eregi("$domain_a",$HTTP_HOST))
{
header("location:./a/");
} else {
header("location:./b/");
}