pmaubo2_55685
Oct 30, 2012Nimbostratus
WAP 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. Can anyone take a look?
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"
} elseif { not ([class match [string tolower [HTTP::header User-Agent]] contains user_agent_tokens_class])}{
Redirect to the normal
HTTP::redirect $normal
log local0. "No WAP"
} else {
}
}
I am using a Nokia simulator to test and then using just a normal browser to test non-list WAP phones.
Thanks for any assistance.