| Welcome to WebmasterWorld Guest from 126.96.36.199 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|htaccess deny from expression|
I was told to use this expression in my htaccess file.
deny from 188.8.131.52/26
I understand how to use the deny from function to deny a normal ip address, but what I don't understand is the 184.108.40.206/26 Is this an ip range? Thanks.
you have to think about netmasks... /26 is the shortform is the netmask... do you know how ip numbers and netmasks work together?
Sorry, I don't.
Is this denying a range of ips?
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:
So 220.127.116.11/26 would be the same as the ip range of 18.104.22.168 to 22.214.171.124.
Is that correct?
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.
That's exactly what I've done.
Thank you, you've been very helpful.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved