homepage Welcome to WebmasterWorld Guest from 54.197.108.124
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
htaccess deny from expression
please explain
guillermo5000




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

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




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

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

guillermo5000




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

Sorry, I don't.

Is this denying a range of ips?

claus




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

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




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

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




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

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




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

That's exactly what I've done.

Thank you, you've been very helpful.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved