This thing is really easy to confuse us. In fact, it is not difficult, as long as you master such a rule can:
Let's start with an example:
Order Deny,allow
Deny from all
Allow from 127.0.0.1
The basis of our judgment is this:
1. Look at the back of the order, which is in front, which is behind
2. If deny is in front, then you need to see the deny from this sentence, and then see the
3. The rule is a matching one, whether deny before or allow before, will be effective. For example, deny all first, then allow 127.0.0.1, so 127.0.0.1 is passed.
Let's take a few more examples:
Order Allow,deny
Deny from all
Allow from 127.0.0.1
This will deny all, 127.0.0.1 will also be denied. Because the order is allow then deny, although the first allow 127.0.0.1, but later rejected it.
Order Allow,deny
Deny from all
All of them are impassable.
Order Deny,allow
Deny from all
All of them are impassable.
Order Deny,allow
All can pass (default), remember to
Order Allow,deny
All are impassable (default), remember to
Apache order allow deny