Knowledge Base Article

How to allow/deny access to your website based on the visitor's browser?

Using Apache .htaccess rules you can deny a visitor depending on his/her browser identification. For example to deny Opera browser accessing your site you can use the following rules:

 

BrowserMatchNoCase opera bad_browser
Order Deny,Allow
Deny from env=bad_browser

 

If you wonder what string to use you should check your site access log. We have decided to use opera in the above example because of the following example:

 

10.1.1.1 - - [07/Jul/2010:05:42:25 -0500] "GET /favicon.ico HTTP/1.1" 404 4503 "http://siteground.com/" "Opera/9.64 (X11; Linux i686; U; en) Presto/2.1.1"

 

In fact you can use any of the bold text in order to create a filter.



Rating

Please indicate if this article was helpful for you.

rating :  4.3 from 5
views :  2526
votes :  11

Related Articles

Views

Haven't found what you are looking for? Suggest an article HERE.

powered by

Valid XHTML 1.0 Strict Valid CSS!