For example, if my '/etc/apache2/httpd.conf' looks like this:
<Directory />
AllowOverride None
</Directory>
<Directory /home>
AllowOverride FileInfo
</Directory>
The latter AllowOverride
rule overrides its predecessor for the /home
directory. That part is clear.
But what happens if my httpd.conf file looks like this?
<Directory /var/www/example.com/public>
AllowOverride None
Options -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
[...]
</IfModule>
[...]
</Directory>
<Directory /var/www/example.com/public/wp-content/cache/minify>
<IfModule mod_rewrite.c>
# WHY IS 'RewriteEngine On' REQUIRED?
RewriteEngine On
RewriteBase /wp-content/cache/minify/
RewriteRule [...]
</IfModule>
</Directory>
QUESTIONS:
Isn't the
RewriteEngine On
in the first<Directory>
section supposed to apply to the second<Directory>
section as well, considering that the latter is a sub-directory? But I noticed that I need to add theRewriteEngine On
rule in the second<Directory>
section as well.Does this mean that I should also copy all the common rules from the first
<Directory>
section to the second<Directory>
section? For example,AllowOverride None
,Options -MultiViews
, etc.