Forum Discussion
pmaubo2_55685
Nimbostratus
Oct 30, 2012WAP and mobile irule question
The goal is if a mobile phone with it's user_agent included in a Data Class to direct it to one site and if it isn't in the Data Class then redirect somewhere else.
I think my logic might be off...
What_Lies_Bene1
Cirrostratus
Oct 30, 2012This should achieve the desired result;
when HTTP_REQUEST {
set wap "https://onesite.com "
set normal "http://www.google.com"
if { [class match [string tolower [HTTP::header User-Agent]] contains user_agent_tokens_class] } {
HTTP::redirect $wap
log local0. "WAP" }
else {
Redirect to the normal
HTTP::redirect $normal
log local0. "No WAP"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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