Forum Discussion
jba3126
Mar 31, 2017Cirrus
iRule to Rewrite User Agent Header
We have a client that has an internal browser policy for IE to run in compatibility mode due to legacy applications. Unfortunately with the latest update to our application servers this causes issues...
Stanislas_Piro2
Apr 02, 2017Cumulonimbus
Hi,
you can merge MSIE 6 to 9 versions in one switch value:
when HTTP_REQUEST {
Rewrite the User-Agent header value to show up supported browser
switch -glob -- [string toupper [HTTP::header User-Agent]] {
"*MSIE [6789]*" -
"*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 {
}
}
}
Also use -- between the last switch parameter and the string to compare. it will prevent minus character in string to be evaluated as another parameter.
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