HTTP::header User-Agent question
I have an irule for we are setting up for featured mobile phones and smart phones.
1 data class list many different codes, for example nokia, the non-smartphones.
The other data class just lists smartphones we support.
The goal is to detect a smartphone and direct it to one site and if it's a featured phone it detects it and directs it.
The problem is, if I use just a PC browser it always seems to take the featured phone path.
If it's just a standard browser on a pc, is there a way to force it to use it.
Seems like the HTTP::header User-Agent is looking into my data class with all the codes and then uses the wap data class regardless. I would think if I am using a not in my "if" it should use the set of normal?
All
Below is the irule
when HTTP_REQUEST {
set wap https://wapsite.com/uri
set normal https://normal.com/uri
set smart https://smartphonesite.com/uri
if { [HTTP::host] equals "https://mysite..com" } {
if { not [class match -- [string tolower [HTTP::header User-Agent]] contains user_agent_tokens_class] }{
log local0. "Normal web site"
HTTP::redirect $normal
}
} else {
if { [class match -- [string tolower [HTTP::header User-Agent]] contains user_agent_tokens_class] }{
log local0. "wap phone"
HTTP::redirect $wap
if {[class match [string tolower [HTTP::header User-Agent]] contains mobile_device_providers]}{
log local0. "smart phone"
HTTP::redirect $smart
event disable
do nothing
} else {
}
}
}
}