Welcome to WebmasterWorld Guest from 23.22.182.29

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

htaccess deny from expression

please explain

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

Junior Member

10+ Year Member

joined:May 16, 2003
posts:109
votes: 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.

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

Preferred Member

10+ Year Member

joined:May 14, 2003
posts:376
votes: 0


you have to think about netmasks... /26 is the shortform is the netmask... do you know how ip numbers and netmasks work together?
10:09 pm on Aug 15, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:May 16, 2003
posts:109
votes: 0


Sorry, I don't.

Is this denying a range of ips?

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 15, 2003
posts:2395
votes: 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

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

Junior Member

10+ Year Member

joined:May 16, 2003
posts:109
votes: 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?

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 15, 2003
posts:2395
votes: 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

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

Junior Member

10+ Year Member

joined:May 16, 2003
posts:109
votes: 0


That's exactly what I've done.

Thank you, you've been very helpful.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members