Through http_user_agent to determine whether the user is from the mobile phone access, or computer IE access.
ASP code Snippets: The main use of the regular matching mobile phone environment, we can add mobile platform.
Copy Code code as follows:
Set regex = new RegExp
Regex.ignorecase = True
Regex.global = True
Regex.pattern = "Mini 9.5|vx1000|lge |m800|e860|u940|ux840|compal|wireless| mobi|ahong|lg380|lgku|lgu900|lg210|lg47|lg920|lg840|lg370|sam-r|mg50|s55|g83|t66|vx400|mk99|d615|d763|el370| Sl900|mp500|samu3|samu4|vx10|xda_|samu5|samu6|samu7|samu9|a615|b832|m881|s920|n210|s700|c-810|_h797|mob-x| sk16d|848b|mowser|s580|r800|471x|v120|rim8|c500foma:|160x|x160|480x|x640|t503|w839|i250|sprint|w398samr810| M5252|c7100|mt126|x225|s5330|s820|htil-g1|fly v71|s302|-x113|novarra|k610i|-three|8325rc|8352rc|sanyo|vx54|c888 |NX250|N120|MTK |c5588|s710|t880|c5005|i;458x|p404i|s210|c5100|teleca|s940|c500|s590|foma|samsu|vx8|vx9|a1000|_ Mms|myx|a700|gu1100|bc831|e300|ems100|me701|me702m-three|sd588|s800|8325rc|ac831|mw200|brew |d88|htc\/|htc_ TOUCH|355X|M50|KM100|D736|P-9521|TELCO|SL74|KTOUCH|M4U\/|ME702|8325RC|KDDI|PHONE|LG |sonyericsson|samsung|240x| X320vx10|nokia|sony cmd|motorola|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle| Mobile|psp|treo|iris|3g_t|windows Ce|opera Mobi|windoWS CE; Smartphone;|windows CE; Iemobile|ipod|iphone|android|opera Mini|blackberry|palm os|palm|hiptop|avantgo|fennec|plucker|xiino|blazer| Elaine|iris|3g_t|windows Ce|opera mobi|windows CE; Smartphone;|windows CE; Iemobile "
Agent = Request. ServerVariables ("Http_user_agent") & ""
If agent <> "" Then
If not regex.test (agent) Then
' Not from the phone to visit, jump to your.domain.com
Response.Redirect ("http://your.domain.com")
End If
End If
Thanks for the ASP code provided by Lao Cao.
Dragonchen82@hotmail.com