Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Forcing to IE 9 Compatability mode iRule

<p>Still sorta new to iRules and I am wondering if anyone can validate this simple iRule I wrote? Hopefully I am on the right track here. </p> <p>What the app teams are ultimately trying to accomplish is to force IE 10 into IE9 compatibility mode. So what I was going to do with the F5 is for every HTTP Response back from the F5 I would insert into the response HTTP header file the following, so the top of the response http header file would look the following:</p> <p><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9"></p> <p>Would by all accounts, would this iRule I wrote do it as I hoped it will. I have not been able to really test it yet, because I will have place in semi-production system, so I want to have you review it first to get your thoughts. </p> <p>when HTTP_RESPONSE { HTTP::header insert <meta> <http-equiv="X-UA-Compatible"> <meta> <content="IE=EmulateIE9"> }</p>
0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

There is a method that can be used via a HTTP header which would be far easier to do than inserting a meta tag. This is my source: http://stackoverflow.com/questions/18024953/x-ua-compatible-ie-9-vs-ie-emulateie9-other-browsers.

So, this would work;

when HTTP_RESPONSE {
 HTTP::header insert "X-UA-Compatible" "IE=EmulateIE9"
}
3
Comments on this Answer
Comment made 20-Sep-2013 by Iceman 1
This performed exactly how we were anticipating. Thanks for the help.
0
Comment made 23-Sep-2013 by What Lies Beneath 6688
Great news, you're welcome.
0
Comment made 3 months ago by UncountedBrute 77

We've tried to do the same for our webtop installation but we haven't had any luck. However we wanted to do IE=Edge instead of emulateIE9.

Does anyone know if this is supported on BIGIP V12.

The issue is that the page gets dropped to compatibility IE7 which breaks the whole page and need to force it out onto edge mode.

0
Comment made 3 months ago by What Lies Beneath 6688

Not sure why you would need it if you are using Edge (and it won't work if you are not). Also:

"This functionality will not be implemented in any version of Microsoft Edge."

From: https://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx

0
Comment made 3 months ago by UncountedBrute 77

The context of the question is that our corporate build forces any website on our domain down to compatibility mode. Our websites therefore have "edge" to stop our pages from breaking (I have no control over the corporate build, i'm just trying to get the site working for it).

We have to support IE, there is no way around it for now so needing the edge tag would be very helpful. Thanks

0
Comment made 3 months ago by What Lies Beneath 6688

I'm confused, surely IE won't support a value of Edge? Although that begs the question why is it an option.

0
Comment made 3 months ago by What Lies Beneath 6688

I'll assume you've tried a value of IE11?

Have you confirmed the header is actually inserted etc.

0
Comment made 3 months ago by UncountedBrute 77

I admit I haven't tried a value of IE11. I will try that now although when looking at the stats, it says the irule has never been evaluated.

0
Comment made 3 months ago by UncountedBrute 77

This is what we've tried:

when HTTP_REQUEST {
    HTTP::header insert "X-UA-Compatible" "IE=Edge"
}

and when HTTP_RESPONSE { HTTP::header insert "X-UA-Compatible" "IE=Edge" }

0
Comment made 3 months ago by What Lies Beneath 6688

Its only required in the response. Are you sure the iRule is assigned to the relevant VS?

Also, if you are, I'd use developer tools on a client browser to confirm the header is sent.

0
Comment made 3 months ago by UncountedBrute 77

It is assigned to both our http vs and https vs and I have checked the network tab but doesn't get included.

0
Comment made 3 months ago by What Lies Beneath 6688

Interesting. Are there other iRules assigned that are perhaps preventing the one that inserts this header from running because event disable is used?

0
Comment made 3 months ago by UncountedBrute 77

No, the only Irule we have on the APM is redirecting http traffic to https which doesn't contain event disable.

0
Comment made 3 months ago by What Lies Beneath 6688

OK, in which case I would add some logging around the header insertion command and see what that shows up.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

If you still need it in the head section, you could use a STREAM profile and the something like the following:

when HTTP_REQUEST {
    STREAM::disable
    HTTP::header remove &quot;Accept-Encoding&quot;
}
when HTTP_RESPONSE {
    if {[HTTP::header value Content-Type] contains "text"}{
        STREAM::expression {@</head>@<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9"></head>@}
        STREAM::enable
    }
}
2
Comments on this Answer
Comment made 15-Aug-2016 by mattsthe2 7

I get an error on this line Kevin.

Code

HTTP::header remove "Accept-Encoding"

Code
0
Comment made 15-Aug-2016 by mattsthe2 7

I get an error on this line Kevin.

HTTP::header remove "Accept-Encoding"

0
Comment made 15-Aug-2016 by mattsthe2 7

wierd i couldnt paste in your code line, it said i was spam. Anyway its that line thats not taking when i save the irule.

Undefined procedure

undefined procedure: Accept-Encoding&quot][Accept-Encoding"]

thanks,

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Hi Iceman, this code needs to be inserted into the http payload.

An http header (as in your sample iRule) would be the wrong place.

As it needs to placed between the <head></head> tags (just googled it), your iRule will not work.

I can have a look at it tomorrow night, if there is no solution in the meantime. Stephan

0
Comments on this Answer
Comment made 09-Jan-2015 by KJ 355
what was solution to this issue? I have similar problem. Thank you
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I just set up a new Citrix instance on my BIG-IP and encountered the exact same issue when using IE11. I added the iRule defined by 'What Lies Beneath' and it works perfectly.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Can someone confirm ? we need to do SSL offload to modify the HTTP the header right ?

0
Comments on this Answer
Comment made 01-Jul-2015 by Baddogsettle 238
I recently replaced our Citrix Secure Gateways with F5 LTM/APM/ASM. Initially had compatibility issues, but added the iRule from 'What lies beneath' and it worked great.
0