Forum Moderators: phranque
I guess it's documentated somewhere, I just cannot seem to find it.
Here's the setup:
document root is /var/www
there is a directory /var/www/test
in /var/www/test/.htaccess, there is
RewriteEngine On
RewriteRule example http:/[smilestopper]/www.example.com/
in /var/www/.htaccess, there is
RewriteEngine On
RewriteRule another http://www2.example.com/
Now if a request on /test/example is made, a redirect to www.example.com kicks in, as expected.
a request to /test/another does not, however, result in a redirect to www2.exmaple.com - that is, unless there is nothing in /var/www/test/.htaccess about mod_rewrite.
I understand the process is like this:
.htaccess are checked for every parent directory of the directory that is valid for the current request.
they are traversed in reverse order by mod_rewrite until one is found that contains rules (that is, if /var/www/test/.htaccess contains rules, they're applied, else /var/www/.htaccess will be checked, untill /.htaccess is reached). Can anyone confirm that or correct me?
My hopes were, before I tested it, to have mod_rewrite continue with the next .htaccess untill a [L] rule is found or there aren't any .htaccess files left. Does anyone know of a way to achieve that without heavily hacking apache or mod_rewrite?
Thanks for any insights.