Forum Moderators: bakedjake

Message Too Old, No Replies

Ban IP Range

Help

         

photoman

6:35 am on Oct 10, 2003 (gmt 0)

10+ Year Member



Hello everyone,

Could someone point out to me what I have done wrong in the following syntax? I am trying to ban the entire IP range of 218.13.0.0 to 218.18.255.255 through htaccess, but it isn't working.

SetEnvIf Remote_Addr ^218\.(1[3-8])\.([0-2][0-5][0-5])\.([0-2][0-5][0-5])$ getout

Thanks for any help anyone can give.

seindal

12:35 pm on Oct 10, 2003 (gmt 0)

10+ Year Member



You will only ban those with three digits in the last two positions.
Just use:

SetEnvIf Remote_Addr ^218\.(1[3-8])\. getout

If you don't care about the last two numbers, don't match them. With regexps, only match what you care about.

René.

photoman

1:43 pm on Oct 10, 2003 (gmt 0)

10+ Year Member



seindal, thank you very much. I wondered if I could do that, but have never seen anyone on these boards doing it in the various threads.

Thanks again!

seindal

1:52 pm on Oct 10, 2003 (gmt 0)

10+ Year Member



Well, regexps can be quite complicated.
O'Reilly has published an entire book on regexps.