capnhud
capnhud

Reputation: 465

Correct way to protect .htacces file

I came across a blog article that indicates that .htaccess files should be protected but I am a little confused as to which part of this is the correct way to implement this security. Here is the snippet:

<Files ~ "^.*\.([Hh][Tt][Aa])">
Order Deny,Allow
#order allow,deny
Deny from all
satisfy all
</Files>

should it be Order Deny, Allow or Order Allow, Deny

Upvotes: 0

Views: 84

Answers (1)

David Wolever
David Wolever

Reputation: 154494

It should be Order Deny,Allow (note the lack of space).

The Order directive defines the order which permission checks should be performed, so Order Deny,Allow says “check the Deny directives before checking Allow directives”.

Upvotes: 1

Related Questions