手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >多中语言实现判断客户访问用得是那个域名 然后转到对应的目录
多中语言实现判断客户访问用得是那个域名 然后转到对应的目录
摘要:多中语言实现判断客户访问用得是那个域名然后转到对应的目录asp版:发表多个绑定多域名的ASP代码如果有有一个ASP空间,而你又想放置多个多个...

多中语言实现判断客户访问用得是那个域名然后转到对应的目录

asp版:

发表多个绑定多域名的ASP代码

如果有有一个ASP空间,而你又想放置多个多个站点,这些代码可以帮到你

第一个

<%ifRequest.ServerVariables("SERVER_NAME")="bbs.along.com.ru"then

response.redirect"bbs"

else

response.redirect"index1.htm"

endif%>

第二个

<%

selectcaserequest.servervariables("http_host")

case"www.along.com.ru"'1

Server.Transfer("along.htm")

case"www.along.net.ru"'2

Server.Transfer("net.htm")

case"www.null.com.ru"'3

Server.Transfer("null.htm")

......继续添加......

endselect

%>

第三个

<%ifinstr(Request.ServerVariables

("SERVER_NAME"),"fjsky.info")>0then

response.redirect"index.asp"

elseifinstr(Request.ServerVariables

("SERVER_NAME"),"along.com.ru")>0then

response.redirect"x/index.asp"

elseifinstr(Request.ServerVariables

("SERVER_NAME"),"along.net.ru")>0thenr

esponse.redirect"index3.asp"

endif

endif

endif%>

第四个

<%ifRequest.ServerVariables("SERVER_NAME")="www.fjsky.info"then

response.redirect"main1.asp"

elseifRequest.ServerVariables("SERVER_NAME")="fjsky.info"then

response.redirect"main1.asp"

elseifRequest.ServerVariables("SERVER_NAME")="www.null2.com.ru"then

response.redirect"/web/index.asp"

elseifRequest.ServerVariables("SERVER_NAME")="null2.com.ru"then

response.redirect"/web/index.asp"

endif

endif

endif

endif%>

第五个

<%

'取得HTTP输入的值并付值到HTOST中

host=lcase(request.servervariables("HTTP_HOST"))

'开始条件跳转

SELECTCASEhost

'如果HOST的值是www.iswind.net就选择事件case"www.iswind.net"的命令

CASE"www.abc.net"

'Belowistheredirectcommand

response.redirect"web/"

CASE"www.efd.com"

response.redirect"web1/"

'WeuseCASEELSEtofixanyotherrequests

CASEELSE

response.redirect"web1/"

ENDSELECT

%>

js版:

<script>

try

{if(self.location=="http://玉米一/")

{

top.location.href="http://玉米一/目录";

}

elseif(self.location=="http://玉米二/")

{

top.location.href="http://玉米二/目录";

}

elseif(self.location=="http://玉米三/")

{

top.location.href="http://玉米三/目录";

}

elseif(self.location=="http://玉米四/")

{

top.location.href="http://玉米四/目录";

}

else

{document.write("错误的访问地址")}

}

catch(e){}

</script>

case"domain.com":

header("location:blog");

break;

default:

header("location:news");

break;

}

?>

或者

<?php

$domain_net="yeahe.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");

}

?>

【多中语言实现判断客户访问用得是那个域名 然后转到对应的目录】相关文章:

用CSS实现垂直居中的3种方法

CSS:使DIV 在浏览器窗口中水平垂直居中

css的字体属性详解

火狐在用offsetHeight获取div的高度时为0的解决方法

在CSS中关于字体处理效果的思考

em与px的区别以及em特点和应用

DIV+CSS网页布局对于网站的好处

dev控件中LookUpEdit的数据绑定问题

IE6下div层被select控件遮住的问题解决方法

CSS基础教程:Borders 边框

精品推荐
分类导航