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");
}
?> 请问怎么用啊。。。看不懂 <?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"); ?> :) 收藏 8错 啊、、、、、、、、、、、 原帖由 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"); ?>
保留 收藏ing。。 什么用啊? 有空试一下看能用否.
页:
[1]