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...
Amine_Kadimi
Mar 31, 2017MVP
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)
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