411 REFERENCE · Wikibooks
Apache/.htaccess
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Principle
In order to protect a directory in particular (and its subdirectories), it suffices to place a file called .htaccess inside. Apache will instantly apply its rules after, only in this tree structure. The syntax is the same as the general vhost rules (eg: URL rewriting or protection), unless it will only affect the .htaccess directory (so no Directory clause).
Attention: the Windows explorer doesn't allow to name some files beginning by a dot, but a text editor is able to save as .htaccess.
Installation
To authorize the .htaccess in the site .conf, use AllowOverridehttp://httpd.apache.org/docs/2.2/mod/core.html#allowoverride:
AllowOverride All
To forbid them:
AllowOverride None
References