Home » Htaccess Tools » Questions regarding htaccess » htaccess Banning by Browser Type
htaccess Banning by Browser Type [message #861] Sun, 27 January 2008 13:18 Go to next message
Apparelyzed  is currently offline Apparelyzed
Messages: 2
Registered: January 2008
Hi all,

I'm new to htaccess, so was hoping someone can advise me how to do the following.

Someone is sending spam through a free service I offer, this service is contained in it's own directory.

Looking at the logs, I have found a common identier which is consistant when this person/bot posts the spam. Unfortunatly, the IP number changes with each post. The following is from my logs:

"-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"

The bit which is consistant, is: Gecko/20070725

Is there a way in htaccess to ban any user showing this information, from accessing a specific area?

Can I then place this htaccess file in the directory containing the service affected, as I don't want to ban this browser site wide in case genuine users are affected.

Many thanks

Simon.
Re: htaccess Banning by Browser Type [message #863 is a reply to message #861 ] Mon, 28 January 2008 00:39 Go to previous messageGo to next message
RogerRogerson  is currently offline RogerRogerson
Messages: 8
Registered: January 2008
I'm not 100% sure, but that looks liek a Mozilla Firefox 2.+ build browser... if you block that, you may block quite a few people.

Can you tell if it's a person or a bot/script?
If a bot, you may be able to block that.
Again, if it's a bot and the problem is a form, you may get away with simply adding a radio option... Are you a)Human b)Bot.. verify the response, and go from there (or employ a checkbox only etc.).

Blocking a user-agent just strikes me as risky.

(of course, I'm not exactly an htaccess genius, so I could be wrong.)
Re: htaccess Banning by Browser Type [message #870 is a reply to message #863 ] Tue, 29 January 2008 17:28 Go to previous messageGo to next message
Apparelyzed  is currently offline Apparelyzed
Messages: 2
Registered: January 2008
Hi,

Unfortunatly, the above is all that's showing in my logs.

Is it possible to put:

"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"

exactly into an htaccess file to block everyone who matches that referal information only?

The area doesn't get too many visitors, could I put the htaccess file just in the specific directory affected?

Thanks

Simon
Re: htaccess Banning by Browser Type [message #871 is a reply to message #870 ] Tue, 29 January 2008 18:12 Go to previous message
RogerRogerson  is currently offline RogerRogerson
Messages: 8
Registered: January 2008
If you look up on thigns like Google, using the terms
" htaccess block by user agent "

You will get a few results with examples and explanations.


As to blockign of a particular Dir.... yes, you should beable to put it in the Dr. and it will only work from there down (or put it in the main route and include a path to the specified Dir.).


hope that helps.
Previous Topic:Limiting Post form values
Next Topic:blocking external access to a folder
Goto Forum:
  


Current Time: Sat May 17 01:48:05 CEST 2008

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software