For example, I have these directives in my .htaccess file:
<Limit GET HEAD POST>
order deny,allow
allow from 1.37.0.0/16
allow from 23.226.128.240/31
allow from 23.234.68.64/27
allow from 23.234.80.200/29
allow from 23.234.91.160/27
deny from all
</Limit>
- What is the meaning of the "/" slashes therein?
- And how can we convert them into
mod_rewrite
directives?
That value defines the number of bits to mask off the most significant bits in the address. See the Wikipedia page on CIDR for more details.
For example, if I specify
10.0.0.0/8
, that means10.*
is allowed (or denied, whatever hte case may be). That's because each octet in an IPv4 address has 8 bits (1 byte, a.k.a. octet). If I specify192.168.0.0/24
, that masks off the first 24 bits (first 3 octets) and192.168.0.*
is allowed or denied.