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 onRewriteBase /RewriteRule ^blog offline.html [L].htaccess in /blogRewriteEngine OnRewriteBase /blog/RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /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,
htaccess execution order and priority
apache;mod rewrite;htaccess
I suppose you should read the Apache Tutorial: .htaccess, mainly the section How directives are applied, which states:The configuration directives found in  a .htaccess file are applied to the  directory in which the .htaccess file  is found, and to all subdirectories  thereof. However, it is important to  also remember that there may have been  .htaccess files in directories higher  up. Directives are applied in the  order that they are found. Therefore,  a .htaccess file in a particular  directory may override directives  found in .htaccess files found higher  up in the directory tree. And those,  in turn, may have overridden  directives found yet higher up, or in  the main server configuration file  itself.Give it a full read and .htaccess will be no mystery anymore.