Forum Moderators: phranque
Yes, and it denies access to all other files as well...
You probably want to use <Files ~ "^\.htaccess$"> or <Files ~ "^\.ht">
The order of directive placement in .htaccess only matters among directives which are processed by the same module. Apache calls each module in turn to process the directives, so the order of module execution is determined by your server configuration, while the order of execution among directives processed by one module are determined by the order you put them in your .htaccess file.
As such, it doesn't matter whether you place your. htaccess file protection code above or below the Options and RewriteEngine directives, because your .htaccess protection code (order, allow, deny) is handled by mod_access, Options is handled by Apache core, and RewriteEngine is handled by mod_rewrite.
In Apache pre-2.0 modules are processed in the reverse order that they appear in the LoadModule list. In Apache 2.0 and later, each module is assigned a priority, and the order of execution is controlled by that.
Jim