Page 1 of 1

php: Create subdomain without apache

Posted: Wed Dec 03, 2003 12:21 pm
by Deimos
//Create a subdomain without apache, you have to point it to index.php . for example http://forums.aq2world.net instead off http://www.aq2world.net/forums/index.php

[php]<?php

$address=" ".getenv("HTTP_HOST");



if (strpos($address,"subdname.domain.com")>0){

$shortcut = "mapname";

}

if (strpos($address,"subdname.domain.com")>0){

$shortcut = "mapname";

}

if (strpos($address,"subdname.domain.com")>0){

$shortcut = "mapname";

}

if (strpos($address,"ssubdname.domain.com")>0){

$shortcut = "mmapname";

}

if (!$shortcut){

$shortcut="/index.php";

}

Header("Location: $shortcut");

?>[/php]