Forum Moderators: phranque

Message Too Old, No Replies

Block an IP in htaccess problem

         

phi148

3:59 pm on Dec 23, 2006 (gmt 0)

10+ Year Member



Hi all,

I'm new to Apache & .htaccess... so I hope you all can bare with me :)

I have a weird bot visiting my website :

bot/1.0 (bot; [;...] bot@bot.bot)
IP : 71.13.115.117

I would like to block this IP.

Can I simply put this in my .htaccess :

Deny from 71.13.115.117

Thanks!

jdMorgan

4:57 pm on Dec 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well generally, yes.

Have you tested it? What was the result?

Jim

phi148

9:56 pm on Dec 23, 2006 (gmt 0)

10+ Year Member



Once I put it in, the bot disappeared... I checked the server logs and the bot IS getting denied.

I just wanted to double check that this 1 line is all I needed.

Now I have another weird bot showing up :

Name: Java/1.5.0_06

IP Address: 62.163.34.97

User Agent: Java/1.5.0_06

Guess I'll block that one too..

jdMorgan

10:06 pm on Dec 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're likely to see "Java/" from many IP addresses and IP address ranges. So, you might want to block that one by User-agent name instead of IP address. You can use SetEnvif to check user-agent names and pass a variable to a Deny directive -- See Apache mod_setenvif and mod_access docs for more info.

Also be aware that some of the Webmaster tools provided by search engines use the Java library, so you may want add exceptions for them.

Jim