我們知道,用js做手機站跳轉到電腦站速度會(huì )慢,而直接使用服務(wù)器語(yǔ)言比較準確而且跳轉速度快,除了因為偽靜態(tài)原因而沒(méi)有辦法做asp或php跳轉的情況,我們都是建議用程序來(lái)做跳轉。
這里是SEO經(jīng)常用的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特定信息 品牌機自帶瀏覽器都會(huì )有
HTTP_UA_OS=Request.ServerVariables(“HTTP_UA_OS”) 手機系統 電腦為空
HTTP_VIA=LCase(Request.ServerVariables(“HTTP_VIA”)) 網(wǎng)關(guān)信息
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