Forum Moderators: phranque

Message Too Old, No Replies

SetEnvIf Referer over an IP Range?

         

keyplyr

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

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




If I wished to ban:

195.xx.168.164
195.xx.168.165
195.xx.168.166
195.xx.168.167
195.xx.168.168

Could I do it like this?

SetEnvIf Referer ^195\.xx\.168\.16[4-8]$ ban
<Files *>
order deny,allow
deny from env=ban
</Files>

Thanks

closed

5:04 am on Nov 2, 2003 (gmt 0)

10+ Year Member



Your code looks fine to me.

But I've got a question: do you want to ban those IPs from visiting your site, or do you want to ban visitors who come from sites that have those IPs?

keyplyr

7:40 am on Nov 2, 2003 (gmt 0)

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




I want to ban those IPs from visiting my site. These were the IPs using the HTTrack download utility I was complaining about here [webmasterworld.com]. All these IPs belong to a UK company. This could just be some employee pulling my site down to their desktop for offline browsing during work hours, or it could be thievery; regardless, he's banned. I did fix the HTTrack RewriteCond, thanks Closed.

closed

8:44 am on Nov 2, 2003 (gmt 0)

10+ Year Member



That's what I thought. You should check for the Remote_Addr instead of Referer.

I usually consult this when I see a directive I'm not familiar with:

[httpd.apache.org ]

Good job correcting the RewriteCond, keyplyr. You're welcome.

keyplyr

9:39 am on Nov 2, 2003 (gmt 0)

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



Thanks for the link - that's a great page. Maybe I will eventually understand enough to utilize it - LOL

closed

4:46 am on Nov 3, 2003 (gmt 0)

10+ Year Member



You're welcome, keyplyr. It came in handy this time because I don't usually use SetEnvIf, and it describes the attributes that the directive accepts.

They call it the "Directive Quick-Reference," and I certainly agree with the quick part. I don't need to know what module a directive is in!

Wizcrafts

3:36 pm on Nov 7, 2003 (gmt 0)

10+ Year Member



Closed wrote:
I usually consult this when I see a directive I'm not familiar with:

[httpd.apache.org...]

Great resource! Thanks for posting it Closed! i really appreciate the examples that they have included for each directive, showing alternate methods for each one, such as different methods of including a custom 403 page or message.

Wiz

closed

1:57 am on Nov 9, 2003 (gmt 0)

10+ Year Member



You're welcome, Wizcrafts. I can't thank them enough. Their documentation is pretty comprehensive and user-friendly.