08980 发表于 2008 年 1 月 3 日 16:35:48

PHP一空间多绑几个域名

<?php
$domain_net="abc.com";
$dot_net_url="bbs/";
$dot_com_url="flash";
if(($HTTP_HOST=="$domain_net")or($HTTP_HOST=="www.$domain_net"))
{
Header("Location: $dot_net_url");
}
else
{
Header("Location: $dot_com_url");
}
?>







<?php   
$arrays=array(   
'www.boranfs.cn'=>'index1.php',   
'wt.boranfs.cn'=>'2.php',   
);   
$url = $arrays[$_SERVER['HTTP_HOST']];   
Header("Location: $url");   
?>
----------------------------------------------------------
例:

index.php
<?php
Header("Location: main.php");
?>

main.php
<?php
$domain_1="abc.com";
$domain_2="abc.net";
if(($HTTP_HOST=="$domain_1")or($HTTP_HOST=="www.$domain_1"))
{
Header("Location: a.htm");
}
elseif(($HTTP_HOST=="$domain_2")or($HTTP_HOST=="$domain_2"))
{
include_once('b.htm');
}
else
{
Header("Location: fuck.htm");
}
?>

shikey 发表于 2008 年 1 月 3 日 16:38:21

请问怎么用啊。。。看不懂

08980 发表于 2008 年 1 月 3 日 16:38:54

<?php      
$arrays=array(      
'www.xxxRRR.com=>'1.php',      
'www.xxx.com=>'2.php',      
);      
$url = $arrays[$_SERVER['HTTP_HOST']];      
Header("Location: $url");      
?>      


PHP代码
重定向到 http://www.xxxRRR.com
<?php         
header("Location:http://www.xxxRRR.com");         
?>         
或者:         
<? header("location:note.php"); ?>

shikey 发表于 2008 年 1 月 3 日 16:39:54

:)

jpfree 发表于 2008 年 1 月 3 日 16:58:24

收藏

waitme 发表于 2008 年 1 月 3 日 19:39:32

8错 啊、、、、、、、、、、、

wykslina 发表于 2008 年 1 月 3 日 23:55:27

原帖由 08980 于 2008-1-3 16:38 发表 http://jgwy.net/images/common/back.gif
      


<?php      
$arrays=array(      
'www.xxxRRR.com=>'1.php',      
'www.xxx.com=>'2.php',      
);      
$url = $arrays[$_SERVER['HTTP_HOST']];      
Header("Location: $url");      
?>      


PHP代码
重定向到 http://www.xxxRRR.com
<?php         
header("Location:http://www.xxxRRR.com");         
?>         
或者:         
<? header("location:note.php"); ?>      



保留

网赚乐园 发表于 2008 年 1 月 4 日 14:51:44

收藏ing。。

wxinlin 发表于 2008 年 1 月 4 日 14:52:54

什么用啊?

duwu 发表于 2008 年 1 月 4 日 15:06:03

有空试一下看能用否.
页: [1]
查看完整版本: PHP一空间多绑几个域名