[url=http://www.phphulp.nl/php/scripts/7/617/]Versie 2 Beschikbaar![/url] Gelieve versie 2 te gebruiken.

<?php
//Eerst kijken wat de bezoeker heeft ingetypt:
$host2 = getenv('HTTP_REFERER');
$host = strtolower($host2);

//Dan doorlinken:
if(($host == "http://subdomein1.domein.tk/" OR $host == "http://subdomein1.domein.tk" OR $host == "http://www.subdomein1.domein.tk/" OR $host == "http://www.subdomein1.domein.tk/" OR $host == "http://www.domein.tk/subdomein1" OR $host == "http://domein.tk/subdomein1" OR $host == "http://www.domein.tk/subdomein1/" OR $host == "http://domein.tk/subdomein1/") 
{ 
Header("Location: mapnaam1/");
}


elseif($host == "http://subdomein2.domein.tk/" OR $host == "http://subdomein2.domein.tk" OR $host == "http://www.subdomein2.domein.tk/" OR $host == "http://www.subdomein2.domein.tk/" OR $host == "http://www.domein.tk/subdomein2" OR $host == "http://domein.tk/subdomein2" OR $host == "http://www.domein.tk/subdomein2/" OR $host == "http://domein.tk/subdomein2/") 
{ 
Header("Location: mapnaam2/");
}


elseif($host == "http://subdomein3.domein.tk/" OR $host == "http://subdomein3.domein.tk" OR $host == "http://www.subdomein3.domein.tk/" OR $host == "http://www.subdomein3.domein.tk/" OR $host == "http://www.domein.tk/subdomein3" OR $host == "http://domein.tk/subdomein3" OR $host == "http://www.domein.tk/subdomein3/" OR $host == "http://domein.tk/subdomein3/") 
{ 
Header("Location: mapnaam3/");
}

//Als de bezoeker een niet geldige/geen subdomeinnaam heeft ingevult:
else
{
Header("Location: index2.php");
}
?>