怎样实现手机访问网站时自动跳转到wap
网站首页为静态index.html,怎么样实现判断当用户为手机用户时自动跳转到wap/谢谢楼下的我的是html页面、...
网站首页为静态 index.html ,怎么样实现判断 当用户为手机用户时自动跳转到wap/
谢谢楼下的 我的是html页面、 展开
谢谢楼下的 我的是html页面、 展开
展开全部
手机访问网站时自动跳转到wap目录或wap站点自动识别跳转代码:
<%
HTTP_ACCEPT=Request.ServerVariables("HTTP_ACCEPT") '获取浏览器的信息
HTTP_USER_AGENT=LCase(Request.ServerVariables("HTTP_USER_AGENT")) '获取AGENT
HTTP_X_WAP_PROFILE=Request.ServerVariables("HTTP_X_WAP_PROFILE") 'WAP特定信息 品牌机自带浏览器都会有
HTTP_UA_OS=Request.ServerVariables("HTTP_UA_OS") '手机系统,电脑为空
HTTP_VIA=LCase(Request.ServerVariables("HTTP_VIA")) '网关信息
Dim WapStr
WAPstr=False
If ubound(split(HTTP_ACCEPT,"vnd.wap"))>0 Then WAPstr=True
If HTTP_USER_AGENT="" Then WAPstr=True
If HTTP_X_WAP_PROFILE<>"" Then WAPstr=True
If HTTP_UA_OS<>"" Then WAPstr=True
IF ubound(split(HTTP_VIA,"wap"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"netfront"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"iphone"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"opera mini"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"ucweb"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"windows ce"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"symbianos"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"java"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"android"))>0 Then WAPstr=True
If WAPstr=True Then
response.redirect "http://boaer.com/wap" '手机站WAP地址一定要完整绝对地址
response.end
End if
%>
<%
HTTP_ACCEPT=Request.ServerVariables("HTTP_ACCEPT") '获取浏览器的信息
HTTP_USER_AGENT=LCase(Request.ServerVariables("HTTP_USER_AGENT")) '获取AGENT
HTTP_X_WAP_PROFILE=Request.ServerVariables("HTTP_X_WAP_PROFILE") 'WAP特定信息 品牌机自带浏览器都会有
HTTP_UA_OS=Request.ServerVariables("HTTP_UA_OS") '手机系统,电脑为空
HTTP_VIA=LCase(Request.ServerVariables("HTTP_VIA")) '网关信息
Dim WapStr
WAPstr=False
If ubound(split(HTTP_ACCEPT,"vnd.wap"))>0 Then WAPstr=True
If HTTP_USER_AGENT="" Then WAPstr=True
If HTTP_X_WAP_PROFILE<>"" Then WAPstr=True
If HTTP_UA_OS<>"" Then WAPstr=True
IF ubound(split(HTTP_VIA,"wap"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"netfront"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"iphone"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"opera mini"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"ucweb"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"windows ce"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"symbianos"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"java"))>0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"android"))>0 Then WAPstr=True
If WAPstr=True Then
response.redirect "http://boaer.com/wap" '手机站WAP地址一定要完整绝对地址
response.end
End if
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询