| Related sites for http://www.devin.com/ieblock_howto.shtml |
| JavaScript_City Free scripts, discussion forums and links to other JavaScript resources. | | Revolution_Photographic Provides 360 virtual tours for real estate and business. | | Midrange_com Free technical discussion mailing lists for AS/400, iSeries, and i5. FAQ. Resources. | | The_Natural_Life_Cycle_of_Mailing_Lists Every list seems to go through the same cycle. | | Perry,_Dewayne University of Texas at Austin - Software engineering, system evolution, large-scale systems. | | Agarwal,_Ashish Java and J2EE codes to help developers in their work. It aims at sharing author's problems and their solutions with the development community. | | Antechinus_JavaScript_Editor A JavaScript code editor. Unified color-coded syntax, context-sensitive help, complete JavaScript reference, categorized source code solutions. [Shareware] | | Tigra_Menu_Online_Builder Web application allowing to build cross-browser DHTML navigation systems. No JavaScript programming skills are required. Also exist Windows version (requare .Net framework). | | Wilson,_Dean_-_Unixdaemon Nix, OSX and Windows Applications, tutorials, code, copies of both published articles and works in progress, links to essential tech tools and author's views on different areas of technology. | | Visual_Languages a description of Visual Programming Languages by Daniel LaLiberte. | | DMesh A Windows 95 mesh creation and deformation tool for use with 3D modeling, rendering and animation software. Primary focus is the generation of smooth-surface mesh objects for use in humanoid and other | | OpenSpark Xtra to provide user interface components including buttons, menus, sliders, progress bars, spin and tab controls. Includes a FAQ, mailing list, and online support. | | Mel\'s_Virtual_Software_Barn Discount software of name brands up to 30/80% off retail prices every day. | | Moscow_Access_User_Group Moscow, Russia. Site available in English and Russian. | | Layershift Offers shared, reseller, managed and unmanaged VPS and DDS hosting services, in the USA and the UK. | | Microsoft_Windows_2000 The official Windows 2000 FAQ from Microsoft. (May 21, 2001) | | 3D_Stings Creates full 3D stings, idents and logos for computer games, DVDs, TV and film. UK based. | | Site*Sleuth Analyses servers log files and presents the information in a useful and easy to understand format. | | SpamStopsHere An email filtering service for businesses or individual domains. 30 day trial offered. | | Netalive_org An alternative to idiot-crowded web communities and spam-filled newsgroups. |
|
How to block MS Internet Explorer from your siteBlocking MSIE from your SiteWhatever your reason, if you'd like to barMicrosoft's Internet Explorer browsers from your site, here's how you canaccomplish it. Note that this could be easily made to work with (or rather,against) any other browser you chose, or against service providers, operatingsystems, IP addresses containing the number '7,' etc.The ethics of the situation, and the decision, are rather complicated. Myown justification is that I'm angered by the degree to which Microsoft hasabused, exploited and tried to control the Internet, and if people are goingto come to my proverbial electronic front door with that browser, I'm going tomake them click through me griping about it first. Users of the web mighthave a reasonable expectation of impartial, gracefully-degraded service, butnot all that plus freedom from other people's grousing. CGI method -- the normal way PHP method -- on servers so equipped Miva Script method -- on servers so equipped SSI (server-parsed HTML) method -- requires Apache 1.2 or later Cold Fusion method Java Server Pages method JavaScript method -- when all else failsCGI MethodThis approach assumes you have the ability to put CGIs on your site, andhave the filenames properly MIME-parsed for display or execution. Ifyour ISP or server environment doesn't provide that, there are a couple other things you can try.Determine what your server looks for as the index for a page. This isalmost universally index.html. Frequently other extensions (e.g. .htm, .shtml,.phtml, etc) are provided for also. Your server admin can probably tell youthis if you're not sure.Make sure your server can handle a CGI as a defined file type andexecute it apropriately. If not, you may need one of the more devious approaches covered later. I'll assume for thispurpose that you're creating index.cgi, and that it will be properlyexecuted.Move your existing index page (index.html or whatever) to some newfilename. I suggest avoiding any of the obvious, sensible choices here --they're easy to guess. Here, I'm going to assume you chose 'piano.shtml' asyour new "homepage" filename.Create your index.cgi; here's the perl code to put in it. This could beeasily done in pretty much any language you liked. Don't use shellcode.#!/usr/bin/perl -Twif ($ENV{'HTTP_USER_AGENT'} && $ENV{'HTTP_USER_AGENT'} =~ /MSIE|Internet Explorer/i) { print "Location: http://www.domain.com/ie_reject.shtml\n\n";} else { print "Location: http://www.domain.com/piano.shtml\n\n";}exit;Adjust the bits to fit your site. The /usr/bin/perl part will varyquite a bit between systems, and the URLs should be edited to fit. Youdon't inherently need the fully qualified URL -- just /filename.html isprobably adequate.Make it world-executable. On most unices, 'chmod +x index.cgi' willaccomplish this.Create your 'reject' file -- the HTML file that MSIE users should see inplace of your actual homepage. Here, that's ie_reject.shtml. My suggestionis that you be polite -- it's the browser you're rejecting (presumably), notthe user, and the company (Microsoft) that you object to, not the personwith the product. They may be extreme novices and not know anything aboutother browsers, or forced to use MSIE one way or another despite that theymight prefer something else. If that doesn't apply, say whatever you bloodywell please. Keep in mind also that you can put your email address on thereject page for people to send their comments, but if you do so you willalso get a lot of derisive and grammatically dubious mail from IE users whowere just given a pithy lecture about their choice of browsers.Adjust links on your site, if you so desire. You should never link tothe default index page anyway -- if you want to link to an index.html in agiven directory, use the name of the directory. As such, assuming you werelinking to /index.shtml, change it to either / or /piano.shtml. If you use/, you'll be re-running the script every time, which is a bit more secureconcerning IE users entering the site without going to /, but also a littleharder on the server.Check it out, and fix any problems. A lot of diferent things can gowrong here, but the biggest one is that index.cgi isn't being executed, forwhatever reason. If you need help, contact your sysadmin or whomever seemsapropriate.CGI method variants:First, if you don't have the option to have a CGI executed as the indexfile for a page, but do have the option to use CGI space located elsewhere, you can use a normal /cgi-bin/-placed CGI instead. To trythat, put this in as your /index.html:<meta http-equiv="refresh" content="0;url=http://www.domain.net/cgi-bin/index.cgi">Then take the code for index.cgi above and put that in /cgi-bin/index.cgi.If you don't have a CGI space available, but can use server-parsed HTML(.shtml, .phtml, etc) and can have your own programs executed by '#includecmd' (or #include cgi) commands, then put this in /index.shtml:<meta http-requiv="refresh" content="0;url="<!--#include cmd="index.cgi"-->">PHP MethodThis works very well on web servers capable of using PHP scripting code. It has the addedadvantage that it doesn't require CGI execution or redirection, andcan't be circumvented by knowing the URL for the "real" page.It's pretty simple, actually. Place this code at or near the top of yourcode, before any output has occurred.<?php if (eregi("MSIE",getenv("HTTP_USER_AGENT")) || eregi("Internet Explorer",getenv("HTTP_USER_AGENT"))) { Header("Location: http://www.domain.com/ie_reject.html"); exit; }?>Update: this is known to work with PHP3 and beta versions of PHP4.Miva Script MethodThis was contributed by Eric Sechrist<newwave/atnewwave.primeline.\moc>. Haven't tried it myself, but theproduct page for it indicates that Miva is a server-side scripting languagewith a respectable supported platforms list.Place this code at the top of your index.mv file, and adjust 'reject.txt'to whatever file you prefer (presumably including HTML):<MvIF EXPR = "{ 'msie' CIN http_user_agent }"><MvDO FILE = "reject.txt"><MvEXIT></MvIF>ColdFusion MethodThis approach works with Macromedia's ColdFusion server-side applicationenvironment (formerly from Allaire). Contributed by JustinFelker.<CFIF findNoCase("msie", cgi.http_user_agent)> <CFLOCATION url="ie_reject.html" addtoken="no"><CFELSE> <CFLOCATION url="real_page.html" addtoken="no"></CFIF>JSP MethodAlso from Justin Felker: this approach works with Sun's Java Server Pages(JSP).<%if (request.getHeader("User-Agent").toLowerCase().indexOf("msie") != -1) response.sendRedirect("ie_reject.html");else response.sendRedirect("real_page.html");%>SSI MethodThis approach employs the flow control element capability in the wonderfulApache webserver, v1.2 and later. As of this writing, more than half thewebservers on the net run Apache, including a large percentage of ISPs andhosting agencies. To find out if you can use this method, telnet to port 80of the webserver and enter "HEAD / HTTP/1.0", then press enter twice; lookthrough the resulting headers for the "Server:" header, which should containthe server name and version. Microsoft's IIS webserver may support somefeature like this also, but chances are if you're running IIS you aren'tlikely to employ this whole procedure anyway. Documentation on Apache'smod_include SSI module can be found here.As above, move your "real" entry page to another file (realhomepage.htmlassumed here), create your IE rejection file (reject.html assumed). You'llgenerally need to create your index file as index.shtml instead of .html;this may vary between webservers. Be sure that index.shtml is the only"index" file present, as many webservers will prefer .html and/or .htm filesover .shtml in the selection order.<!--#if expr="$HTTP_USER_AGENT = /MSIE/" --><!--#include virtual="reject.html" --><!--#elif expr="$HTTP_USER_AGENT = /Internet Explorer/" --><!--#include virtual="reject.html" --><!--#else --><!--#include virtual="realhomepage.html" --><!--#endif -->This approach has the advantage of working on a large portion ofwebservers; however, it does not prevent loading the "real" page via MSIEvia some other path (search engine referral, etc).JavaScript MethodThis is a good fallback if you aren't able to use any server-executed code.It has the benefit of being fairly difficult to defeat, since it workson the browser's appName property, which is usually hardcoded into thebrowser and is difficult to change. The disadvantages are that, first, itwill annoy users of browsers that don't use javascript; second, it willpermit entry by MSIE users when they have JavaScript disabled. The<meta> redirect will attempt to cope with browsers that don't supportor aren't configured to use JS.Move your index.html file to another filename as above.Place the following in a new index.html file:<html><head> <meta http-equiv="refresh" content="1; URL=http://www.domain.com/realhomepage.html"></head><body><script language="javascript"><!--if (navigator.appName == "Microsoft Internet Explorer") { document.location = "http://www.domain.com/ie_reject.shtml"; } else { document.location = "http://www.domain.com/realhomepage.html";}// --></script></body></html>Adjust the URLs accordingly.Devin Carraway |
|