Forum Moderators: mack
But this morning I have had 6351 accesses from IP address 64.230.83.149 with the user agent "Java/1.4.1_05" "-" for a 200 page site - and this has really p****d me off. (In fact all the accesses were to a sub folder which only contains about 10 files!)
Anyone know of a beginners way to get started on banning some IPs?
Might I suggest reading thru this thread?
How to protect from site copiers like teleport?
How to stop undesired crawlers and spiders [webmasterworld.com]
Pendanticist.
So, in notepad create a file called .htaccess.txt
and insert the following (example)?
<Files .htaccess>
deny from all
</Files>
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*NEWT
RewriteRule ^.* - [F]
RewriteCond %{HTTP_REFERER} ^http://www.iaea.org$
RewriteRule!^http://[^/.]\.your-site.com.* - [F]
This list is the beginning of Toolmans list in this thread:-
[webmasterworld.com...]
The your-site.com should be changed to my-domain.co.uk
and if I wanted to add useragents I would insert a new line - each line needs an [OR] on the end except the last user agent, so if I wanted to ban the user agent from my first post it would be something like :-
RewriteCond %{HTTP_USER_AGENT} ^Java/1.4.1_05 [OR]
This file should be saved and uploaded to the root and renamed .htaccess
Can anyone confirm if the above is correct or if I am going wrong somewhere?
If you view Toolmans post on the above thread he has said (the top bit is left out) - should there be something above <Files .htaccess>?
[edited by: Dayo_UK at 5:38 pm (utc) on Sep. 19, 2003]
The comment (the top bit is left out) - should there be anything before <Files .htaccess>?
I will have to test it on one of my smaller sites first me thinks ;)
>> the top bit is left out
The .htaccess file can be used for a lot of purposes. I don't really know what Toolman has in the beginning of his .htaccess file but it could very well be something that did not concern banning of bots.
You might need the top two lines of the minimalist example below, but it's not certain that they are required on your server, it depends on the configuration:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^Java [NC]
RewriteRule .* - [F,L] What this does is:
If you need to add more User-Agents or IPs or whatever, just make the [NC] an [NC,OR] and insert a new line.
For further reading, here's part 2 of "A close to perfect .htaccess ban list" - the full thread is around 20 or so pages now, but it contains a lot of good advice.
[webmasterworld.com...]
/claus
I am new here, have spent the last 2 hrs going through the posts in hope of finding a solution to my problem.
Let me say that I am TOTALLY NOT computer literate. Phew! Now that that has been said, here is my problem.
I want to deny a few IP address access to my site, but have absolutely NO clue as to how to go about it.
I use FrontPage to build my pages, if this makes a difference?!
Any help would be greatly appreciated! Remember though, if you can help me, it has to be a step-by-step direction! :)