Where can I get the code to block all web browsers from accessing my web site other than INTERNET EXPLORER?

Posted on November 29th, 2009 by admin

Where can I get the code to block all web browsers from accessing my web site other than INTERNET EXPLORER.
I would like the page to say "browser is not supported"
please can someone help me. it will be gladly appreciated!

There is no such code to flat-out block access based on web browsers. It is also unethical to do so on one’s part.
Web pages need to respect certain open, web standards. Internet Explorer is just one of the many browsers and not even the best, I fail to see your reasoning for blocking it. If it’s because the website only renders correctly in Internet Explorer, then at most what I would do would put a message, warning visitors "best viewed in Internet Explorer".

4 Responses

  1. fishbone Says:

    There is no such code to flat-out block access based on web browsers. It is also unethical to do so on one’s part.
    Web pages need to respect certain open, web standards. Internet Explorer is just one of the many browsers and not even the best, I fail to see your reasoning for blocking it. If it’s because the website only renders correctly in Internet Explorer, then at most what I would do would put a message, warning visitors "best viewed in Internet Explorer".
    References :

  2. SteveZman Says:

    if your web host supports active server pages ( ASP ) you can use

    <%Browser=Request.ServerVariables (HTTP_USER_AGENT)%>

    then block it by

    <%
    If Browser = Internet Explorer Then
    ‘ do nothing
    Else
    Response.Write "Browser Not supported, sorry"
    End If
    %>
    References :
    MCSE

  3. Mark F Says:

    You can do it with javascript. First of all grab the code from Microsoft’s site for detecting the IE browser version (I’ll post it again here). If it’s 0 then you can stop the page from loading by executing the Stop command. Note that this will only stop the page from displaying, the underlying html code will still be sent to the client. If you want to actually stop the rest of the page from being sent then you’ll have to do it server-side instead.

    <html><header><header/><body>

    <script>
    function msieversion()
    {
    var ua = window.navigator.userAgent
    var msie = ua.indexOf ( "MSIE " )
    if ( msie > 0 ) // If Internet Explorer, return version number
    return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
    else // If another browser, return 0
    return 0

    }

    var version = msieversion();
    if (version == 0)
    {
    document.write("Browser not supported");
    document.execCommand(’Stop’)
    }
    else
    document.write("Welcome IE" + version + "<p />");

    </script> And here is some body text<body/></html>
    References :
    http://support.microsoft.com/kb/167820

  4. ganendexin t Says:

    most virus are spread through IE. IE is not a safe browser. you should use a more secure browser to protect your PC from virus.

    i recommand you to use firefox with Google toolbar. firefox can block any any popup and disable any virus and adware, spyware on webpage, so, firefox is much safer than IE browser. as you know, most of virus spread throught internet and webpage.

    besides, firefox is much smaller than IE, so it run faster than IE.

    download firefox for free, Just have a try:

    http://www.securebrowser.info/firefox/

    Good Luck !!!
    References :

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Filed under web browsers | 4 Comments »

|
  • Categories

  • Pages

  • Tags

  • Archives

  • Meta

  •