: Htaccess execution order and priority Can anyone explain to me in what order apache executes .htaccess files residing in different levels of the same path and how the rewrite rules therein are
Can anyone explain to me in what order apache executes .htaccess files residing in different levels of the same path and how the rewrite rules therein are prioritized?
For example, why doesn't the rewrite rule in the first .htaccess below work and is the one in /blog prioritized?
.htaccess in /
RewriteEngine on
RewriteBase /
RewriteRule ^blog offline.html [L]
.htaccess in /blog
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
PS: I'm not simply looking for an answer but for a way to understand the apache/mod_rewrite internals ... why is more important to me than how to fix this,
More posts by @Gretchen104
1 Comments
Sorted by latest first Latest Oldest Best
You can use RewriteOptions inherit to inherit the rewrite rules of the parent directory. However, the parent directory's rewrite rules will be applied later, as per the documentation on RewriteOptions.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.