笑申Blog

爱笑的我,用这里记录着生活和工作的每一天。

导航

« php论坛自动更换头像的小文件根据线路、镜像速度分流自动跳转代码 »

根据域名跳转的代码(ASP/PHP)

ASP

<%
if Request.ServerVariables("SERVER_NAME")="mcncc.com" then
response.redirect "1.asp"   
else if Request.ServerVariables("SERVER_NAME")="www.mcncc.com" then
response.redirect "2.asp"   
else
response.redirect "404.html"   
end if
end if
%>


PHP

<?php
switch ($_SERVER["HTTP_HOST"])
{
case "aaa.com": 
header("location:aaa.com");
break;
case "www.bbb.com":
header("location:www.bbb.com");
break;
case "aii.net.ru":
header("location:aii.net.ru");
break;
case "aii.org.ru":
header("location:aii.org.ru");
break;
case "www.1111.com":
header("location:www.1111.com");
break;
case "1111.com":
header("location:1111.html");
break;
}
?>

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Spirit Build 80722 Using ThinkTwice Theme Designed By Sino Blog

Copyright © 2005-2008 liushen.net. ALL Rights Reserved.