Forum Moderators: phranque

Message Too Old, No Replies

blocking a java spider

how to block efficiently a java spider in htaccess

         

longa

6:18 pm on Jun 20, 2009 (gmt 0)

10+ Year Member



I would like to block a spider which id's with "Java/1.6.0_04"
I tried to block it but have no success.
following is the code I use:
RewriteCond %{HTTP_USER_AGENT} ^(java¦curl¦wget).* [NC,OR]
which does not work or
RewriteCond %{HTTP_USER_AGENT} ^(Python[-.]?urllib¦Java/?[1-9]\.[0-9]) [NC]
which is not working either.
does anyone maybe know what is wrong or what I miss.
thanks for help

jdMorgan

7:21 pm on Jun 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



RewriteConds are only conditional qualifiers for the RewriteRule which follows them. I do not see a RewriteRule following either of your RewriteConds.

I'd suggest you review other threads here dealing with blocking specific user-agents (try the Search link at the top of this page), and take a look at the mod_rewrite documentation at Apache.org. To be blunt, "guessing at" mod_rewrite code is often suicidal, in that it's quite easy to kill your site by doing so.

Jim