|
- 以下代码插入index.asp第57行
- 57行代码为 domain1= Replace (Left (domain,InStr (domain,".")),".","")
- 下面
- <%
- if domain1="wap" or domain1="3g" then
- dim m,c,com
- M="xxx.com/wap" '设置手机访问地址
- C="xxx.com/wapmo" '设置电脑访问地址
- com=true '是否为电脑访问 true false
- If Request.ServerVariables("HTTP_X_WAP_PROFILE") Then com=false
- If InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"vnd.wap.wml") > 0 And InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/html")=0 Then com=false
- If InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"vnd.wap.wml") And InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/html") Then
- If InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"vnd.wap.wml")< InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/html") Then
- com=false
- End If
- End If
- Set reg = New RegExp
- str="CECT,Compal,CTL,LG,NEC,TCL,Alcatel,Ericsson,BIRD,DAXIAN,DBTEL,Eastcom,PANTECH,Dopod,PHILIPS,HAIER,KONKA,KEJIAN,LENOVO,BenQ,MOT,Soutec,Nokia,SAGEM,SGH,SED,Capitel,Panasonic,SonyEricsson,SIE,SHARP,Amoi,PANDA,ZTE"
- str=Replace(str,",",")|(")
- reg.pattern=".*("&str&").*"
- reg.IgnoreCase = True
- If reg.test(Request.ServerVariables("HTTP_USER_AGENT")) Then com=false
- if com=true then
- response.redirect c
- else
- response.redirect m
- end if
- end if
- %>
|