Virtuel SubDomain.
Hej E.Har problemer med at få dette til at virke på mit webhotel.
Har smidt dem en email pr d.d for at høre om de evt har subdomains slået til, hvilket vil gøre det ikke virker.
Nu vil jeg så bare høre om mit script stadig er up2date og vil virke på de forskellige php versioner.
koden:
<?php
$host = $_SERVER["HTTP_HOST"];
if( substr($host,0,4) == 'www.') {
$host = substr($host,4);
}
list ($sub, $domain, $end) = explode('.', $host);
if($end== "" OR $sub == "www") {
echo $sub.".".$domain.".".$end;
//header("Location: index2.php");
exit;
}
else {
if(is_dir($sub)) {
header("Location: http://www.$domain.$end/$sub/");
echo $sub.".".$domain.".".$end;
//
exit;
}
else {
header("Location: index2.php");
echo $sub.".".$domain.".".$end;
//
exit;
}
}
?>
- BlackScorpion.
