Forum Moderators: phranque

Message Too Old, No Replies

Block all non-human traffic with .htaccess

Is it possible to only allow browsers and no bots?

         

bouncybunny

5:56 am on Jul 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just wondering if it is possible to write .htaccess rules that would block everything but IE, Netscape, Firefox, Safari and Opera?

And yes I also want to block Google Yahoo and MSN. ;)

Any tips?

phranque

6:40 am on Jul 13, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you can certainly block based on user agent but the user agent can be spoofed.

you should read through this extensive WebmasterWorld thread on blocking bots [webmasterworld.com].

bouncybunny

1:30 am on Jul 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks.

Sure, I appreciate that it's not foolproof, but I just wondered if anyone had done this and what method they used? I have used .htaccess to block bots before, but have never used it to only *allow* certain user agents, rather than *disallow*.

Any help appreciated.

I tried the method here [webmasterworld.com...]
but it keeps giving me internal server errors.

[*EDIT] Found a solution, all is well again ;)