# Get out of IE6

**URL:** <https://community.f5.com/t/get-out-of-ie6/66161>\
**Category:** Community CodeShare\
**Tags:** content-manipulation, irules, devops, application-delivery\
**Created:** [March 18, 2015, 7:06pm UTC](https://community.f5.com/t/get-out-of-ie6/66161 "2015-03-18T19:06:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Bhattman](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/the_bhattman/32/13958_2.png) [@The\_Bhattman](https://community.f5.com/u/The_Bhattman)\
**Post date:** [March 18, 2015, 7:06pm UTC](https://community.f5.com/t/get-out-of-ie6/66161/1 "2015-03-18T19:06:27Z")

</div>

**Problem this snippet solves:**

Description: [DevCentral - An F5 Technical Community](https://devcentral.f5.com/weblogs/Joe/archive/2009/02/24/help-users-get-out-of-the-stone-age-with-irules.aspx)

## Related Article

> **[BBC News - Google phases out support for IE6](http://news.bbc.co.uk/2/hi/technology/8488751.stm)**
>
> Google begins phasing out support for Microsoft's Internet Explorer 6, the browser identified as the weak link in a cyber attack.

**Code :**

```auto
when RULE_INIT {
  # replace the value of the _uacct variable with your Google Analytics account.
  set static::warnie6 "<!--\[if lte IE 6\]>
<style type='text/css'>
#ie6msg {border:3px solid #c33; margin:8px 0; background:#fcc; color:#000;}
#ie6msg h4 {margin:8px; padding:0;}
#ie6msg p {margin:8px; padding:0;}
#ie6msg p a.getie7 {font-weight:bold; color:#006;}
#ie6msg p a.ie6expl {font-weight:bold; color:#006;}
</style>
<div id='ie6msg'>
<h4>Did you know that your browser is out of date?</h4>
<p>To get the best possible experience using my website I recommend that you upgrade your browser to a newer version. 
The current version is  
<a class='getie7' href='http://www.microsoft.com/windows/Internet-explorer/default.aspx'>Internet Explorer 8</a>. 
The upgrade is free. If you are using a PC at work you should contact your IT-administrator. 
Either way, I'd personally like to encourage you to stop using IE6 
and try a more secure and Web Standards-friendly browser.</p>
<p>You could also try some other popular browsers like 
<a class='ie6expl' href='http://mozilla.com'>FireFox</a> or <a class='ie6expl' href='http://www.opera.com'>Opera</a>.</p>
</div>
<!\[endif\]-->"
}
when HTTP_REQUEST {
  # Don't allow data to be chunked
  if { [HTTP::version] eq "1.1" } {
    if { [HTTP::header is_keepalive] } {
       HTTP::header replace "Connection" "Keep-Alive"
    }
    HTTP::version "1.0"
  }
}
when HTTP_RESPONSE {
  if { [HTTP::header Content-Type] starts_with "text/html" } {
    if { [HTTP::header exists "Content-Length"] } {
      #log local0. "content length: [HTTP::header {Content-Length}]"
      set content_length [HTTP::header "Content-Length"]
    } else {
      set content_length 1000000
    }
    #log local0. "Collecting $content_length bytes"
    if { $content_length > 0 } {
       HTTP::collect $content_length
    }
  }
}
when HTTP_RESPONSE_DATA {
  #log local0. "Content Type: [HTTP::header Content-Type]"
  set idx [string first "" [HTTP::payload]]
  if { -1 == $idx } {
    set idx [string first "" [HTTP::payload]]
  }
  #log local0. "html body tag found at $idx"
  if { -1 == $idx } {
    set idx 0
  } else {
    incr idx 6
  }
  HTTP::payload replace $idx 0 $static::warnie6
}

```
