Forum Moderators: phranque

Message Too Old, No Replies

RewriteCond not working

         

keyplyr

3:01 am on Nov 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Analog says that HTTrack took 527 pages and 909 files. HTTrack is a mirroring tool, so it looks like this user went to my site map and replicated every page in the domain, example:

195.XX.168.168 - - [01/Nov/2003:16:07:07 -0800] "GET /page.html HTTP/1.1" 200 4725 "http://www.my-domain/site-map.html" "Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)"

I have it blocked via .htaccess:

RewriteCond %{HTTP_USER_AGENT} ^HTTrack [NC,OR]

So why was this guy able to use it? Thanks

closed

3:38 am on Nov 2, 2003 (gmt 0)

10+ Year Member



You have a ^ at the beginning of the pattern, so there will only be a match if the user agent begins with HTTrack.

keyplyr

3:54 am on Nov 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Seems this user can change IPs at will. I had his IP blocked, so he switched the last digit and took another 139 pages and 222 files.

I just removed the beginning anchor. So Closed, are you saying the way I had the RewriteCond the UA would have had to look like this? (HTTrack 3.0x; Windows 98)

closed

4:41 am on Nov 2, 2003 (gmt 0)

10+ Year Member



Well, if you mean the UA string inside the parentheses, yes. The UA would have had to begin with HTTrack, so your RewriteCond would have only blocked UAs like these:

HTTrack
HTTrack 3.0x
HTTrackblahblahblah

By removing the ^, you're telling Apache to search for the pattern anywhere in the UA string, which is what you want in this case.