Welcome to WebmasterWorld Guest from 54.226.194.180

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

htaccess deny from expression

please explain

     

guillermo5000

9:49 pm on Aug 15, 2003 (gmt 0)

10+ Year Member



I was told to use this expression in my htaccess file.

deny from 12.148.209.192/26

I understand how to use the deny from function to deny a normal ip address, but what I don't understand is the 12.148.209.192/26 Is this an ip range? Thanks.

wkitty42

9:54 pm on Aug 15, 2003 (gmt 0)

10+ Year Member



you have to think about netmasks... /26 is the shortform is the netmask... do you know how ip numbers and netmasks work together?

guillermo5000

10:09 pm on Aug 15, 2003 (gmt 0)

10+ Year Member



Sorry, I don't.

Is this denying a range of ips?

claus

1:23 am on Aug 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes it covers a range of IPs - you can write it in your .htaccess file exactly as you did in post #1.

Here's a good one-page intro to netmasks that actually explains it:

[support.zen.co.uk...]

/claus

guillermo5000

5:20 am on Aug 16, 2003 (gmt 0)

10+ Year Member



So 12.148.148.209/26 would be the same as the ip range of 12.148.209.192 to 12.148.209.255.

Is that correct?

claus

2:09 pm on Aug 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



well i have not calculated it myself, but if you translate the IP to binary, the first 26 characters should remain unchanged and the rest (6) should take on all conceivable values (0 and 1).

Set the remaining six to 000000 and 111111 respectively and calculate/translate to decimal - if that is what you have done, then you're right.

It seems very likely that it is from 192 to 255 though, in fact that would be my guess without calculating.

/claus

guillermo5000

5:34 pm on Aug 16, 2003 (gmt 0)

10+ Year Member



That's exactly what I've done.

Thank you, you've been very helpful.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month