httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Admin <barons...@gmail.com>
Subject Re: [users@httpd] How to deny access based on user agent - help
Date Fri, 23 Jun 2006 16:52:35 GMT
This wont work as it will compare the first instance of "Mozilla" and 
deny access.
Almost all browsers (in my knowledge) have this as the first thing in 
the user agent string.
This would mean almost everybody will be denied access.

Joshua's rule of browsermatch works as it compares the entire string to 
  the condition that has to be satisfied.

Sanjay Dutt

Ahn, Chang wrote:
> RewriteCond %{HTTP_USER_AGENT} '^Mozilla'
> RewriteRule ^/(.*)  http://www.blah.com/ [L,R]
> 
> 
> This should catch agent that starts with Mozilla. - read
> http://httpd.apache.org/docs/1.3/misc/rewriteguide.html
> 
> 
> 
> -----Original Message-----
> From: Admin [mailto:baronsoft@gmail.com] 
> Sent: Friday, June 23, 2006 9:32 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] How to deny access based on user agent - help
> 
> Hi,
> 
> There is one particular spammer who I want to deny access to my web
> site.
> 
> He is leaving comments & sending emails through the contact form which
> are full of p*rn site urls etc.
> 
> He is spoofing his ip address so denying access on ip is out. The only
> thing consistent is the browser he uses. The string returned in the
> access log is "Mozilla/4.0 (compatible; MSIE 5.01; MSNIA; Windows 98)"
> and I thought I can deny access to the web site for this user agent as
> till now this guy is the only one visitor to my site using a browser
> returning this string.
> 
> I am a newbie and do not have much knowledge of regular expressions etc.
> 
> I know that with the proper settings in the htaccess file I should be
> able to stop him.
> 
> Mod rewrite is available.
> Web server is Apache 1.3.34.
> 
> Any pointers/help will be highly appreciated.
> 
> Regards.
> Sanjay Dutt
> 
> --
> The Dutts Home Site: www.thedutts.com
> 
> 
> 


-- 
The Dutts Home Site: www.thedutts.com



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.2/373 - Release Date: 6/22/2006


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message