Forum Discussion
Chris_D_15752
May 02, 2011Nimbostratus
Mobile redirect with forced SSL
Hi guys,
I am faced with dual puzzle for site demending dual function redirect causing some issses.
I need to provide detection process from www.main.com site provide mobile type v...
hooleylist
May 05, 2011Cirrostratus
A few of the lines in the switch statement were missing the hyphen. I also set the User-Agent string to lower case so you don't have to use multiple patterns to handle mixed cases.
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "nativeweb-site.com" } {
switch -glob [string tolower [HTTP::header User-Agent]] {
"*blackberry*" -
"*blazer*" -
"*palm*" -
"*smartphone*" -
"*danger*" -
"*hiptop*" -
"*mot-*" -
"*razr*" -
"*audiovox*" -
"*symbian*" -
"*nokia*" -
"*sony ericsson*" -
"*samsung*" -
"*lg 8*" -
"*alcatel 735i*" -
"*nextel*" -
"*windows ce*" -
"*audiovox*" -
"*au-mic,*" -
"*alcatel*" -
"*benq*" -
"*casio*" -
"*cdm-*" -
"*ericsson*" -
"*ezos*" -
"*kyok*" -
"*kyocera*" -
"*lg-*" -
"*lge-*" -
"*nec-*" -
"*nokia*" -
"*nok6*" -
"*nokia*" -
"*mitsu*" -
"*mot-*" -
"*motorola*" -
"*sagem*" -
"*sagem*" -
"*sendo*" -
"*sonyericsson*" -
"*panasonic*" -
"*pantech*" -
"*qc-*" -
"*playstation portable*" -
"*philips*" -
"*samsung*" -
"*sama*" -
"*sec-s*" -
"*sec-n*" -
"*sanyo*" -
"*sharp*" -
"*sie-*" -
"*sony*" -
"*symbianos*" -
"*symbian os*" -
"*portalmmm*" -
"*vodafone/*" -
"*kddi-*" -
"*j-phone*" -
"*blazer*" -
"*avantgo*" -
"*avantbrowser.com*" -
"*danger*" -
"*hiptop*" -
"*proxynet*" -
"*iemobile*" -
"*mobileexplorer*" -
"*.web*" -
"*palm*" -
"*series60*" -
"*palmsource*" -
"*palmos*" -
"*midp-2.0*" -
"*midp-1.0*" -
"*cldc-1.0*" -
"*cldc-1.1*" -
"*series60*" -
"*opera mini*" -
"*mobilephone*" -
"*netfront*" -
"*nitro*" -
"*docomo*" -
"*obigo*" -
"*pocketpc*" -
"*pocket pc*" -
"*regking*" -
"*smartphone*" -
"*smartphone*" -
"*epoc*" -
"*rover*" -
"*ipaq*" -
"*jornada*" -
"*iopus*" -
"*inassap*" -
"*minimo*" -
"*plucker*" -
"*ericy*" -
"*softbank*" -
"*willcom*" -
"*yospace*" -
"*tagtag*" -
"*winwap*" -
"*up.link*" -
"*pdxgw*" -
"*astel*" -
"*wap1.*" -
"*xiino*" -
"*up/4*" -
"*maemo*" -
"*windows ce*" -
"*mspie*" -
"*microsoft pocket internet explorer*" -
"*elaine*" -
"*eudoraweb*" -
"*reqwirelessweb*" -
"*jbrowser-wap*" -
"*lenovo*" -
"*m3gate*" -
"*cellphone*" -
"*sony cmd*" -
"*wapsilon*" -
"*telme*" -
"*linux armv*" -
"*sony/com1*" -
"*embedix armv5tel*" -
"*xplore g*" -
"*mobileok ddc*" -
"*google wap proxy*" -
"*google chtml proxy*" -
"*netfront*" {
HTTP::redirect "http://mobile.site.com[HTTP::uri]"
return
}
}
if { [string tolower [HTTP::header Accept]] contains "vnd.wap.wml" } {
HTTP::redirect "http://mobile.site.com[HTTP::uri]"
return
}
if { [TCP::local_port] != 443 }{
HTTP::redirect "https://nativeweb-site.com[HTTP::uri]"
}
}
}
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects