php: Create subdomain without apache

Forum for anything hard- or software related.

Moderator: Moderators

Post Reply
Deimos

php: Create subdomain without apache

Post 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]
Post Reply