程序自动判断,从电脑跳转到手机的ASP源码

发布时间:2024-06-04 点击:62
我们知道,用js做手机站跳转到电脑站速度会慢,而直接使用服务器语言比较准确而且跳转速度快,除了因为伪静态原因而没有办法做asp或php跳转的情况,我们都是建议用程序来做跳转。
这里是seo经常用的asp版本手机判断跳转的源代码:
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://m.390seo.com/”
response.end
end if


创建网站要怎样选择合适的字体大小
一家专业的建站公司应该具备哪些服务
网站优化容易忽略什么重点?
【html简单网页代码模板】高端网站建设的体会心得
提高企业站加载速度的实用技巧
这样创建食品饮料网站才能爆红
自己建网站如何让Banner图更有魅力
中小型的旅游网站如何建站?