This will allow your users to be redirected according to wub-doamin prefix.
Download
View Source (print view)
Rating : 4.7
Views : 445
<?
//===============================\
// Author:Patrick Loven \
// Name: Sub-Domain Redirect \
// Date: 11/09/01 \
// Site: www.lovenresources.com \
//===============================\
/*------------------------------------------------------------------------\
There are 2 ways of doing this, static and dynamic(for those few fortunate
enough to allow wildcard sub-domians). In either case, your isp must allow
sub-domains, and add them for you.
Static - This is setup to pass the user directly to the folder you want
based on the pre in the pre.domain.ltd. If criteria is passed, they will
be forwarded to the specified folder.
i.e. : search.domain.com => search.domain.com/search/
Dynamic - This is setup to pass the user to a dynamic "pre named folder"(i.e
users/whatever_dynamic),based on the pre in the pre.domain.ltd. If criteria
is passed, they will be forwarded to the specified folder.
i.e. : whatever.domain.com => domain.com/users/whatever/
whatever2.domain.com => domain.com/users/whatever2/
//------------------------------------------------------------------------*/
$where = explode(".",$HTTP_HOST);
$default = ("yourstartpage.xxx");
/* Static
if($where[0] == "whatever1"){
header("Location:http://$HTTP_HOST/whatever1/");
}elseif($where[0] == "whatever2"){
header("Location:http://$HTTP_HOST/whatever2/");
}else{
header("Location:http://$HTTP_HOST/$default");
}
*/
// Dynamic
if(is_dir("$DOCUMENT_ROOT/$where[0]")){
header("Location:http://$HTTP_HOST/$where[0]");
}else{
header("Location:http//$HTTP_HOST/$default");
}
?>
download, regirstration form, php_snips, fedex, call php', userstatusinonline, php_script"_class="neww"_target="_blank"_title="im_neuen, best ide, php script" class="neww" target="_b..., forum, p t test paired, guest, php_tools, href php function, utfraw, php jobs, php script and char(124) (select cast(count(1) as varchar(8000)) char(124) from [sysobjects] where 1=1)>0 and =, commit, gonzo_florin, yahoo status check, rss