Yes it's the correct way.
But to be more semantic: Yes, it's the correct way to allow
.htaccess to override all directives in the
As you found out,
AllowOverride is allowed only under the
Using your example:
This is telling apache, that all configurations can be overridden in the
/var/www and all its sub-directories (recursively).
For a better example, consider you have the following configuration in your virtual host:
And the following directory structure:
What I did here, is create an
.htaccess in every sub-directory of the
It usually shouldn't be like so, but this is just for the sake of the example
Comparing the directory structure with the configuration, it means that all
.htaccess files inside in the
/var/www folder and its sub-directories, excluding the
/var/www/uploads directory and its sub-directories, can override all kinds of directives.
/var/www/uploads and its sub-directories can only use the
.htaccess file to override the
Note: As of apache 2.4 (Which is available by default in 13.10+) the
Order directives were replaced by a single directive named