广汉做网站,广汉网站建设,广汉模板建站,广汉aspcms仿站

Title:ASP代码判断手机访问并跳转的代码

DATA:2014-08-14 17:37:22 VISITORS:

Tags:SEO观点  作者:快宜优网络    来源:www.k1u.com.cn

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.Write "请访问手机版本http://www.k1u.com.cn"   '这里填写您的手机版网址

response.redirect "http://www.k1u.com.cn"              '这里填写您的手机版网址

response.end

else   

'response.redirect "http://www.k1u.com.cn"

'response.end

End if


上一篇:seo新手做友情链接要警惕

下一篇:没有了!