Forum Discussion
Question on Redirect to mobile website - plz help
- Apr 18, 2015
Had an extra ] at the end of the third if statement. This should fix it for you.
when HTTP_REQUEST { if {[class match [HTTP::header User-Agent] contains abcd_useragents] } { if {[HTTP::cookie MobileOptOut] eq 1} { return } if {[URI::query [HTTP::uri] MobileOptOut] eq 1} { return } switch -glob [string tolower [HTTP::path]] { "*.jpg" - "*.gif" - "*.png" - "*.bmp" - "*.ico" { return } } HTTP::redirect "http://m.xyzdomain.com[HTTP::uri]" } }
Hi Kevin/Anyone who can help, We have made some changes and now we dont use redirect website anywhere else like m.xyz.com, but just have it on different servers in a pool and have f5 redirect to that pool if the useragent is mobile.
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::header User-Agent]] contains "mobile_useragents1" ] } {
if {[HTTP::cookie MobileOptOut] eq 1} { return }
if {[URI::query [HTTP::uri] MobileOptOut] eq 1} { return }
pool p-mobile-redirect
}
}
I'm currently facing issue where the MobileOptOut feature is not working.
I'm suspecting issue with cookies.
I have cookie persistence 1hr activated on the vip. so anything sent to mobile pool has a cookie inserted with mobile pool memeber.
When user hits OptOut, uri becomes ?MobileOptOut=1 he is sent to regular (desktop) pool and a new cookie with desktop pool member is inserted.
I want tio understand how will the cookie conflict rule? I mean who will supercede whom? Will the new desktop pool cookie work over the mobile pool cookie? or vice versa?
Thanks in advance!
Recent Discussions
Related Content
* 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