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 doing this by the use of the following commands
Is it possible to do the same thing in an iRule when a client connects to a virtual server which hosts IIS servers.
Could I use the following
HTTP::respond [content ] [noserver] [ ]+
If so, what values would I put where?
- The_Bhattman
Nimbostratus
There is an articular which depicts a way to insert the code ito page to inform a client to upgrade. I suppose the same can be done to insert a piece of code based on it detecting IE8 - Looks to me like the above config is for IIS and is just creating a custom response header for all requests. If you want to add this to all requests, regardless of the browser, it would be as simple as this:
when HTTP_RESPONSE { HTTP::header insert "X-UA-Compatible" "IE=EmulateIE7" }
when HTTP_RESPONSE { if { ! [HTTP::header exists "X-UA-Compatible"] } { HTTP::header insert "X-UA-Compatible" "IE=EmulateIE7" } }
- earton_25699
Nimbostratus
Thanks for replies. Will let you know how it goes - Doh! Don't write iRules for a few weeks and see what happens. Thanks for the catch hoolio!
- bilsch_10068
Nimbostratus
I have been working on a rule to do this but it does not quite work. Any ideas? - hoolio
Cirrostratus
A global variable will be accessible and changeable across all TCP connections. You'd want to use a local variable so that it's only accessible across a single TCP connection.when HTTP_REQUEST { Check if User-Agent header is IE 8 if { [HTTP::header User-Agent] contains "MSIE 8" } { set IE8Resp 1 } else { set IE8Resp 0 } } when HTTP_RESPONSE { if { $IE8Resp } { log "[IP::client_addr]:[TCP::client_port] inserting header" HTTP::header insert "X-UA-Compatible" "IE=EmulateIE7" } }
- bilsch_10068
Nimbostratus
Yea that makes sense on the regexp - good point. Thanks! Posted By hoolio on 03/25/2009 9:14 AM
- The_Bhattman
Nimbostratus
This should be uploaded in the samples - hoolio
Cirrostratus
Hey cmbhatt, it's a wiki, so you could add it too :D. Here you go:
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