![]() |
|
|||||||
| 网赚研究院 研究网络赚钱、电子商务的新技术、动态。 |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
IP: 61.139.126.97
|
|||
|
|||
|
$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"); } ?> 再如: Quote:
Quote:
Quote:
Last edited by topvip : 2008-02-15 at 10:39 PM |
|
#2
IP: 61.139.126.97
|
|||
|
|||
|
Quote:
Last edited by topvip : 2006-10-15 at 01:53 PM |
|
#3
IP: 61.139.126.97
|
|||
|
|||
|
这是一段很有用的代码,和绑定多域名的ASP代码类似,如果你只有一个PHP空间,而你又想放置多个多个站点,下面这些代码可以帮到你。
第一个: if($HTTP_HOST=="www.0058.net"){ Header("Location: facai.htm"); } elseif($HTTP_HOST=="www.dns.com.cn"){ Header("Location: xinwang.htm"); } else{ Header("Location: other.htm"); } 第二个: if($HTTP_HOST=="www.0058.net"){ require "facai.htm"; } elseif($HTTP_HOST=="www.dns.com.cn"){ require "xinwang.htm"; } else{ require "other.htm"; } |
|
#4
IP: 61.139.126.97
|
|||
|
|||
|
$domain_year="bbs.1001year.net";
$domain_cate="1001cate.com"; $domain_pet="1001pet.com"; $domain_1001qb="1001qb.com"; $dot_year_url="year.php"; $dot_cate_url="cate.php"; $dot_pet_url="pet.php"; $dot_1001qb_url="1001qb.php"; if(($HTTP_HOST=="$domain_year")) { Header("Location: $dot_year_url"); } elseif(($HTTP_HOST=="$domain_cate")or($HTTP_HOST=="www.$domain_cate")or($HTTP_HOST=="bbs.$domain_cate")) { Header("Location: $dot_cate_url"); } elseif(($HTTP_HOST=="$domain_pet")or($HTTP_HOST=="www.$domain_pet")or($HTTP_HOST=="bbs.$domain_pet")) { Header("Location: $dot_pet_url"); } else { Header("Location: $dot_1001qb_url"); } ?> |
|
#5
IP: 61.139.126.97
|
|||
|
|||
|
再写一个好代码,可以试下:
Quote:
|
|
#6
IP: 61.139.126.97
|
|||
|
|||
|
下面的一段代码也不错的:
Quote:
Last edited by admin : 2006-10-15 at 11:02 PM |
|
#7
IP: 61.139.126.97
|
|||
|
|||
|
如绑定到一个文件名:
Quote:
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|