Forum Moderators: open

Message Too Old, No Replies

Blocking certain Ua's namely Java/1.5.0_06

         

eljefe3

2:02 am on May 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have someone spidering my site with various java user agents as in the above, and whenever I see this I ban their ip, but they just use rotating proxies, so I'm usually one step behind them.

Is there any semi-easy non-techie way to ban anyone who comes in with this UA? Using robots.txt doesn't work.

encyclo

9:56 am on May 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Using mod_rewrite (if you have Apache) is the only way, there was a thread about this very bot back in February:

[webmasterworld.com...]

From that thread, jdMorgan suggests:

# Block Java and Python URLlib except from Google and Yahoo
RewriteCond %{HTTP_USER_AGENT} ^(Python[-.]?urllib¦Java/?[1-9]\.[0-9]) [NC]
RewriteCond %{REMOTE_ADDR} !^207\.126\.2(2[4-9]¦3[0-9])\.
RewriteCond %{REMOTE_ADDR} !^216\.239\.(3[2-9]¦[45][0-9]¦6[0-3])\.
RewriteRule .* - [F]

You will need to change the

¦
character to a solid pipe and this board alters the character.

eljefe3

1:29 am on Jun 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Great thanks.

eljefe3

8:19 am on Jun 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok so I changed the pipes and then put this in my .htaccess. Uploaded and then when trying to view the site an error 500 comes up. Is this due to a bad pipe, or having the code in the wrong place? I already have a 403 handler and some deny ip addresses listed in the .htaccess, but don't know much about this .htacess stuff.

Dijkgraaf

9:12 am on Jun 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Some web servers aren't configured to allow ReWrite.
That could cause it to throw an error.
You could try using deny instead. Do a search for ".htaccess deny"