htaccess execution order and priority
Posted
by
ChrisRamakers
on Pro Webmasters
See other posts from Pro Webmasters
or by ChrisRamakers
Published on 2011-02-14T08:49:39Z
Indexed on
2011/02/21
23:33 UTC
Read the original article
Hit count: 312
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/modrewrite internals ... why is more important to me than how to fix this :) Thanks!
© Pro Webmasters or respective owner