.htaccess commands are case insensitive

.htaccess

I see the same .htaccess code snippet written with two different ways as follows:

<Files .htaccess>
order allow,deny
deny from all
</Files>

and

<Files .htaccess>
Order Allow,Deny
Deny from all
</Files>

I'm I right to assume both versions are equally valid? Are all .htaccess commands case insensitive?

Best Answer

Order, Allow, Deny: those are called apache directives, and these three belong to mod_authz_host module (as of Apache 2.1 and later versions). In principle the apache directives are case-insensitive, so both are valid. See here:

Directives in the configuration files are case-insensitive, but arguments to directives are often case sensitive. Lines that begin with the hash character "#" are considered comments, and are ignored. Comments may not be included on the same line as a configuration directive. White space occurring before a directive is ignored, so you may indent directives for clarity. Blank lines are also ignored.

Related Topic