Forum Discussion

Kemstar_50071's avatar
Kemstar_50071
Icon for Nimbostratus rankNimbostratus
Aug 23, 2012

Control Browser version

Need help, Is there a way to control IE version for accessing certain web applicaion that only support IE8 using iRule? and denial other browser version. Thanks

 

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus
    Kemstar,

     

     

    You could use the http:header cmd and query the user-agent.

     

     

    Hope this helps,

     

    N
  • tried this irule, not sure what's wrong, it blocks IE8 as well.

     

     

    when HTTP_REQUEST {

     

    if {not ([string tolower [HTTP::header User-Agent]] contains "MSIE 8.0")} {

     

    HTTP::respond 200 content {

     

     

     

    sorry, but the browser is not supported.

     

     

    }

     

    log local0. "Unhandled User Agent: [HTTP::header User-Agent]"

     

    }

     

    }
  • tried this irule, not sure what's wrong, it blocks IE8 as well.

     

     

    when HTTP_REQUEST {

     

    if {not ([string tolower [HTTP::header User-Agent]] contains "MSIE 8.0")} {

     

    HTTP::respond 200 content {

     

     

     

    sorry, but the browser is not supported.

     

     

    }

     

    log local0. "Unhandled User Agent: [HTTP::header User-Agent]"

     

    }

     

    }
  • You are "string tolower'ing" the URI but comparing it to an upper case string so it will never match. Try

    if { not ([string tolower [HTTP::header User-Agent]] contains "msie 8.0") }

    And see if that helps...

    -Joe