Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 01:52:37 PM

Pages: [1]   Go Down
  Print  
Author Topic: .HTACCESS banning range of ip's  (Read 1368 times)
comatose
Spacescooter Operator
*****
Offline Offline

Posts: 31


« on: April 05, 2009, 06:40:21 AM »

I want to ban a block of ip addresses .
continuous range from 77.0.0.0 to 95.255.255.255

how do i write this in my .htaccess file ?

thanks
Logged
wektech
Master Jedi
*****
Offline Offline

Posts: 1031



WWW
« Reply #1 on: April 05, 2009, 07:29:37 AM »

I think the deny lines for this would be:
deny from 77.0.0.0/8
deny from 78.0.0.0/7
deny from 80.0.0.0/4
Logged

comatose
Spacescooter Operator
*****
Offline Offline

Posts: 31


« Reply #2 on: April 05, 2009, 07:50:48 AM »

someone told me i have to do it like this:

order allow,deny
deny from 77.0.0.0/8
deny from 78.0.0.0/8
deny from 79.0.0.0/8
deny from 80.0.0.0/8
deny from 81.0.0.0/8
deny from 82.0.0.0/8
deny from 83.0.0.0/8
deny from 84.0.0.0/8
deny from 85.0.0.0/8
deny from 86.0.0.0/8
deny from 87.0.0.0/8
deny from 88.0.0.0/8
deny from 89.0.0.0/8
deny from 90.0.0.0/8
deny from 91.0.0.0/8
deny from 92.0.0.0/8
deny from 93.0.0.0/8
deny from 94.0.0.0/8
deny from 95.0.0.0/8
allow from all


is this correct ?
isn't there an easier way ?

for instance in my forum all i have to do is "77-95.*.*.*" and it would deny all of above,
can i do it this way in my .htaccess file ?
Logged
Mitch
Berserker Poster
*****
Offline Offline

Posts: 12838


WWW
« Reply #3 on: April 06, 2009, 05:20:13 AM »

I think you got the basics down.  Here is another good article on this topic:

http://www.hybrid6.com/webgeek/2006/12/htaccess-ip-banning-block-bad-visitors.php
Logged

New to Web Site Hosting? Check Out the Lunarpages Blog Hosting Guide!


Follow us @lunarpages on Twitter!
Important Threads: Read This Before Posting! | Lunarforums Rules! | Mitch's Link of the Day!
Also, be sure to check out and subscribe to the Lunartics Blog and the Lunarpages Newsletter !

Need Web Hosting Help? Check out the Lunarpages Web Hosting Wiki. It has tons of tips, tutorials and resources!
Pages: [1]   Go Up
  Print  
 
Jump to: