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 version/release services.
I establised individual VIP exposed and registered externally with m.main.com. Requests sourcing from mobile devices are detected and redirected to m.version VIP using script I enclosed below. It works well and relatively all devices are detected and rediected properly. All are happy and I still have the job. Problem develops with adding SSL force redirect after mobile deterction takes place. Standard http_https_redirect fails to complete after my first script runs.
Concept is relatively simple. All traffic to standard VIP is redirected to SSL. Same applies to mobile frame devices and they all need to be SSL forced.
Can you please share some light on single or dual step scripts you know work with this requirements?
I appreciate your help .
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::header User-Agent]] {
"*blackberry*" -
"*windows ce*" -
"*palm*" -
"*sonyericsson*" -
"*lg*" -
"*sie*" -
"*up.b*" -
"*up*" -
"*motorola*" -
"*mot-*" -
"*astel;*" -
"*j-phone*" -
"*netfront*" -
"*xiino*" -
"*iphone*" -
"*benq*" -
"*cricket*" -
"*andr*" -
"*htc*" -
"*nokia*" -
"*portalmmm *" -
"*samsung*" -
"*sec*" -
"*vodafone*" -
"*smartphone*" -
"*symbian*" {
HTTP::redirect "]"
return
}
}
if { [string tolower [HTTP::header Accept]] contains "vnd.wap.wml" } {
HTTP::redirect "]"
return
}
if { [HTTP::header exists "MSISDN"] } {
HTTP::redirect "]"
return
}
- Chris_D_15752NimbostratusHi guys,
- Chris_D_15752NimbostratusGuys -
- hooleylistCirrostratusHow does a mobile user opt out of the mobile site? Is there a specific URL they can access? Can you have the mobile site set a cookie if they opt out? Or could you use an iRule to set a cookie if they opt to use the full site? If so, you could put a check for the cookie first in the full to mobile site redirect rule and just exit the event if it's there.
- Chris_D_15752NimbostratusThanks for your help Aaron,
- hooleylistCirrostratusYou could add a check for the application set cookie at the top of the iRule using something like this:
when HTTP_REQUEST { Check if the full site cookie preference has already been set if {[HTTP::cookie value "full_site_cookie"] eq "some_value"}{ Exit this event in this iRule to avoid a possible redirect to the mobile site return } ... rest of the iRule logic to check for mobile user-agents and redirect them to the mobile site }
- Chris_D_15752NimbostratusAaron,
- hooleylistCirrostratusHi Rafael,
- Rafael_LombardiNimbostratusHi Aaron,
- Rafael_LombardiNimbostratusAaron,
- Rafael_LombardiNimbostratusAaron,
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