打印本文 打印本文 关闭窗口 关闭窗口
根据域名跳转的ASP/PHP代码
作者:武汉SEO闵涛  文章来源:敏韬网  点击数1562  更新时间:2010/3/20 17:08:18  文章录入:mintao  责任编辑:mintao
根据域名跳转的ASP代码
以下是代码片段:
<%
if Request.ServerVariables("SERVER_NAME")="mintao.net" then
response.redirect "1.asp"   
else if Request.ServerVariables("SERVER_NAME")=www.mintao.net then
response.redirect "2.asp"   
else
response.redirect "404.html"   
end if
end if
%>
根据域名跳转的PHP代码
以下是代码片段:
<?php
switch ($_SERVER["HTTP_HOST"])
{
case "mintao.net": 
header("location:mintao.net");
break;
case www.mintao.net:
header("location:www.mintao.net");
break;
case "blog.mintao.net":
header("location:blog.mintao.net");
break;
case "tao.ggbing.com":
header("location:tao.ggbing.com");
break;
case "www.ggbing.com":
header("location:www.ggbing.com");
break;
case "mintao.net":
header("location:index.asp");
break;
}
?>
打印本文 打印本文 关闭窗口 关闭窗口