htaccess help

htaccess help

am 28.07.2007 02:00:39 von Mike

Two quick htaccess questions....

1) how can I block a specific HOST name from my site?
2) How can I block access to a specific URL (URI) on my site. Some
time ago I foolishly had a guestbook with public write access on my
site. That, of course, was abused by spambots. I've since removed
the page, but still get several thousand automated hits to the page
each day. Just viewing the 404 page is having an impact on my
bandwidth utilization, so I'd prefer to just block access to anyone
requesting the page.

Thanks!

Mike

Re: htaccess help

am 28.07.2007 09:44:57 von Floor

Mike:

> 2) How can I block access to a specific URL (URI) on my site. Some

Use your router for that. Bandwith it will cost you anyway, for without a
request you can't ban this spider.
Floor

Re: htaccess help

am 28.07.2007 19:32:10 von Mike

On Jul 28, 12:44 am, "Floor" wrote:
> Mike:
>
> > 2) How can I block access to a specific URL (URI) on my site. Some
>
> Use your router for that. Bandwith it will cost you anyway, for without a
> request you can't ban this spider.
> Floor

I've considered tossing up a PHP page at that URL, which adds the host
address to a ban list in the htaccess file. A rudamentary
honeypot... Does anyone have a script I can use?

Thanks!

Re: htaccess help

am 28.07.2007 22:24:34 von Paul Furman

Mike wrote:

> Two quick htaccess questions....
>
> 1) how can I block a specific HOST name from my site?

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [OR]
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
....etc
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.* - [F,L]

or if that's not what you mean, this blocks ip ranges for most of
eastern europe & beyond, I assume you could put the host stuff in there
instead of ip numbers or find out that host's ip range:


order allow,deny
allow from all
deny from 62.133
deny from 81.30
deny from 195.70



> 2) How can I block access to a specific URL (URI) on my site. Some
> time ago I foolishly had a guestbook with public write access on my
> site. That, of course, was abused by spambots. I've since removed
> the page, but still get several thousand automated hits to the page
> each day. Just viewing the 404 page is having an impact on my
> bandwidth utilization, so I'd prefer to just block access to anyone
> requesting the page.

I'm not sure but maybe something like this:

RewriteEngine on
RewriteRule ^www\.mydomain\.com/private.htm* - [F,L]


--
Paul Furman Photography
http://edgehill.net
Bay Natives Nursery
http://www.baynatives.com