Du gemmer denne som din index.php:
<?
$domain = \"DINSIDE.DK\";
$default_page = \"INDEX.HTM\";
$use_frames = \"yes\";
$underdomaene = $HTTP_HOST;
$underdomaene = eregi_replace(\"\\.\".$domain, \"\", $underdomaene);
$underdomaene = eregi_replace(\"www\\.\", \"\", $underdomaene);
$underdomaene = strtolower($underdomaene);
# If the sub domain is the name of a directory in the document root...
if (is_dir(\"$DOCUMENT_ROOT/$underdomaene\")) {
# The frames version:
if ($use_frames == \"yes\") {
echo \"<html><head><title>TITEL</title>\\n\\n\";
echo \"</head>\\n\\n\\n\\n\";
echo \"<frameset cols=100%,* frameborder=no border=0 framespacing=0>\\n\";
echo \"<frame src=http://$domain/$underdomaene>\\n\";
echo \"</frameset></html>\\n\";
}
# The non-frames version:
else {
header(\"Location:
http://$domain/$underdomaene\");
}
}
# If the sub domain is NOT the name of a directory in the document root...
else {
if (!$REQUEST_URI || $REQUEST_URI == \"/\") {
include(\"$DOCUMENT_ROOT/$default_page\");
}
else {
header(\"Location:
http://$domain$REQUEST_URI\");
}
}
?>
Jeg har IKKE lavet dette script!
- Anders