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...
nitass
Employee
Oct 30, 2012i think you have to add additional condition in if clause, such as host header or uri, to prevent redirection loop.
e.g.
when HTTP_REQUEST {
if { [HTTP::host] equals "onesite.com" } {
if { not [class match -- [string tolower [HTTP::header User-Agent]] contains user_agent_tokens_class] }{
HTTP::redirect "http://www.google.com"
}
} else {
if { [class match -- [string tolower [HTTP::header User-Agent]] contains user_agent_tokens_class] }{
HTTP::redirect "https://onesite.com"
}
}
}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