PDA

View Full Version : .htaccess and blocking IE



dnmouse
07-04-2010, 07:18 AM
I have a linux only forum and would like to block internet explorer or better still windows os from accessing my site how would i do this in .htaccess

dnmouse
07-04-2010, 07:21 AM
I forgot to put that i tried this here but kept getting 503
http://kb.siteground.com/article/How_to_allowdeny_access_to_website_based_on_visito r_browser.html

Anatoli
07-07-2010, 03:51 AM
Thank you for the interesting question :)

Here is how I have done it. In the .htaccess file I have placed:

BrowserMatchNoCase Windows bad_os
Order Deny,Allow
Deny from env=bad_os


This works for me and Windows pcs can't access the site.

dnmouse
07-07-2010, 05:03 AM
Thankyou that worked a treat, without being to cheeky how would i redirect to a page when they are blocked

Svetlio
07-07-2010, 06:56 AM
To add a redirection for the 403 error message modify the .htaccess in the following way:

BrowserMatchNoCase Windows bad_os
Order Deny,Allow
Deny from env=bad_os

ErrorDocument 403 http://Yourdomain.com/default.htm
<Files default.htm>
Order Deny,Allow
Allow from all
</Files>

In the above code replace your domain name. Instead default.htm enter the exact name of the file to which the redirection should point.