Forum Discussion

J__Warner_48356's avatar
J__Warner_48356
Icon for Nimbostratus rankNimbostratus
Oct 26, 2016

User-Agent redirect to use any browser except IE

Looking through many different posts and have not found an irule that works my requirements. I am looking to have the irule detect if URL is opened in IE and auto redirect in Chrome or Firefox browser. The closet i have been able to find is:

 

when HTTP_REQUEST { switch -glob [string tolower [HTTP::header User-Agent]] { "firefox" { do nothing and allow request to go to the VS pool } default { HTTP::redirect "http://abcdefg.com[HTTP::uri]" } } }

 

10 Replies

  • Clarify your question a bit, please. You want to redirect based on browser, or you want IE to be forcibly changed to Firefox or Chrome?

     

    One is easy but unreliable, the other isn't possible.

     

  • Not going to be possible for so many security reasons.

     

    Perhaps an alternative is to redirect IE to a website declaring the requirement for Firefox or Chrome and providing links for download.

     

    Basically you want an end user to trust your/any website to run arbitrary code on their PC. I think you can see the security problem that would present.

     

  • We currently have a webserver that is performing this. They want to utilize the F5 to perform it. Here is the server script.

     

  • That is horrifying. I can't imagine F5 is going to let you emulate that in an iRule.

     

  • To echo ekaleido's words, I never knew you can force a client machine to pick another browser. You could end up breaking any security/compliance posture. Sorry, not being helpful with the actual question but found this conversation interesting.

     

  • The scary part is that is a functional piece of IE (note it's called by a hook into ActiveX) and it could potentially be used to run ANY piece of arbitrary code.

     

  • you can try this irule:

     

    when HTTP_REQUEST {
        Check if the URI is /maintenance
       if {[string tolower [HTTP::header "User-Agent"]] contains msie} {
              Send an HTTP 200 response with a Javascript
             HTTP::respond 200 content \
    "Browser redirectinsert your code herebody>\
    Wrong browser, we will try to start a real internet browser :)" "Content-Type" "text/html" 
             return
          }
       }
    }