You have another approach, using the switch statement:
when HTTP_REQUEST {
Rewrite the User-Agent header value to show up supported browser
switch -glob [string toupper [HTTP::header User-Agent]] {
"*MSIE 6*" -
"*MSIE 7*" -
"*MSIE 8*" -
"*MSIE 9*" -
"*MSIE 10*" {
Replace the User-Agent header with supported user agent
HTTP::header replace "User-Agent" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
}
default {
}
}
}
A better approach is not using iRule but using a traffic policy (Local Traffic ›› Policies)