Forum Discussion
earton_25699
Nimbostratus
Mar 21, 2009iRule for IE8
With the release of IE8 yesterday, I need to be able to automatically make users who have IE8 installed to be forced into an IE7 compatible mode. I have read some articles on Microsoft that details do...
bilsch_10068
Nimbostratus
Mar 25, 2009I have been working on a rule to do this but it does not quite work. Any ideas?
reference sites
1) http://msdn.microsoft.com/en-us/library/cc817582.aspx
2) http://msdn.microsoft.com/en-us/library/cc817570.aspx
rule IE8Fix {
when RULE_INIT {
set ::IE8Resp 0
}
when HTTP_REQUEST {
if { [regexp {"MSIE ([0-9]{1,}[\.0-9]{0,})"} [HTTP::header User-Agent] origUA UAVer ] } {
switch $UAVer {
"8.0" {
set ::IE8Resp 1
log "[IP::client_addr]:[TCP::client_port] IE 8 detected"
}
"7.0" {
set ::IE8Resp 0
log "[IP::client_addr]:[TCP::client_port] IE 7 detected"
}
default {
log "[IP::client_addr]:[TCP::client_port] IE $UAVer detected"
}
}
}
}
when HTTP_RESPONSE {
if { $::IE8Resp } {
todo, make sure the header insert format is right
log "[IP::client_addr]:[TCP::client_port] inserting header"
HTTP::header insert "X-UA-Compatible" "IE=EmulateIE7"
}
}
}
I was trying to make it only trigger when the browser was IE8...
Is my impression that the entire rule ( eg, http_request, http_response, rule_init ) execute on a per-request/response pair or is that not the case?
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