爱情故事情感网

www.88mylove.com

注册 / 登录

感人文章

爱情故事

情感文章

伤感日志

网络日记

12星座

好文章

家常菜

许愿祝福

热门搜索

当前位置: 爱情故事情感网 -> 妙招大全 -> 根据来路域名将客户转向到不同页面的ASP代码

根据来路域名将客户转向到不同页面的ASP代码

访问数:1396次 作者小鲍 发表日期:2011-07-16 12:50:36

asp代码
<%
if request.servervariables(""server_name"")=""chinainf.cn"" then
response.redirect(""/1"")
else if request.servervariables(""server_name"")=""www.chinainf.cn"" then
response.redirect(""/1"")
else
response.redirect(""/2"")
end if
%>

ASP

第一个
<%if Request.ServerVariables(""SERVER_NAME"")=mouse.net"" then
response.redirect ""zkj""
else
response.redirect ""i.htm""
end if%>

第二个
<%
select case request.servervariables(""http_host"")
case ""mouse.net.ru"" 1
Server.Transfer(""v3.htm"")
case ""im286.net.ru"" 2
Server.Transfer(""i.htm"")
case ""www.mouse.net"" 3
Server.Transfer(""yyjs.htm"")
...... 继续添加 ......
end select
%>

第三个
<%if instr(Request.ServerVariables
(""SERVER_NAME""),""mouse.net.ru"")>0 then
response.redirect ""index.asp""
else if instr(Request.ServerVariables
(""SERVER_NAME""),""im286.net.ru"")>0 then
response.redirect ""x/index.asp""
else if instr(Request.ServerVariables
(""SERVER_NAME""),""www.im286.net.ru"")>0 then
response.redirect ""index3.asp""
end if
end if
end if%>

第四个
<%if Request.ServerVariables(""SERVER_NAME"")=""mouse.net.ru""
then
response.redirect ""index1.asp""
else if Request.ServerVariables(""SERVER_NAME"")=""im286.net.ru"" then
response.redirect ""index2.asp""
else if Request.ServerVariables(""SERVER_NAME"")=""www.mouse.net.ru"" then
response.redirect ""index3.asp""
end if
end if
end if%>


第五个
<%
取得HTTP输入的值并付值到HTOST中
host=lcase(request.servervariables(""HTTP_HOST""))
开始条件跳转
select CASE host
如果HOST的值是mouse.net.ru就选择事件case""mouse.net.ru""的命令
CASE ""mouse.net.ru""
Below is the redirect command
response.redirect ""index1.htm""
CASE ""im286.net.ru""
Below is the redirect command
response.redirect ""/blog""

We use CASE ELSE to fix any other requests
CASE ELSE

其他方式访问的目录
response.redirect ""/index1.htm""
END select
%>

 

JS

<script>try {if( self.location == ""http://玉米一/"" ) {
top.location.href = ""http://玉米一/目录"";
}
else if( self.location == ""http://玉米二/"" ) {
top.location.href = ""http://玉米二/目录"";
}
else if( self.location == ""http://玉米三/"" ) {
top.location.href = ""http://玉米三/目录"";
}
else if( self.location == ""http://玉米四/"" ) {
top.location.href = ""http://玉米四/目录"";
}
else {document.write (""错误的访问地址"")}} catch(e) {}</script>

<%
Dim MyName 默认www.88mylove.com站首页文件名
MyName = Lcase(Request.ServerVariables(""http_host"")) 取得当前工作访问的服务器名,并转换成小写,返回结果如www.im286.com,im286.com,SenFe.im286.com等
MyName = Mid(MyName,1,InStr(MyName,""."")-1) 取得当前访问的二级域名名字,也就是第一个小数点.左边的部分,返回结果如www,im286,senfe等

If MyName=""www"" Or MyName=""im286"" Then
Response.Redirect ""/Index.Htm"" 当名字为www,或者没有时(取得是im286),则转向默认首页地址
Else
Response.Redirect ""/"" & MyName & ""/"" 转向以用户名命名的目录
End If
Response.End
%>

0    0

上一篇:无
下一篇:经典DIV+CSS代码 经典的三行两列DIV+CSS代码布局
以下内容为爱情故事情感网妙招大全根据来路域名将客户转向到不同页面的ASP代码的评论与回复
回复此贴:
用户协议:不欺诈 不虚假 不违法 不发表攻击言论 不损人利己
爱情故事情感网-最感人的文章-最感人的爱情故事-好文章-情感故事-最新经典伤感日志大全
© 2007-2024 www.88mylove.com >>  Email:770111722@qq.com
辽ICP备08005173号