I am trying to implement some mod_rewrite RewriteRules using WordPressMU. I tried putting them in the Virtural Host file, but they did not appear to work. Since WPMU has a set of mod_rewrite RewriteRules in a .htaccess file, I wondered if the order of precedence was the problem. It seems that was indeed the cause. Here is the order of Apache configuration processing order of precedence that I found:
1. Apache configuration file is parsed top to bottom.
2. Included files are parsed right at their include location. In other words within the configuration file.
3. For directives which are called more than once, the last call overrides the previous calls.
4. For a directive called more than once in a directory tree, the lowest call in the directory tree takes precedence.
5. .htaccess directives take precedence over the main configuration file Directives.
So, it does seem that the .htaccess directives are overriding the Virtual Host file.
Thanks to this source for helping clear this up: http://data-based-systems.com/articles/papers/ApacheNotes.html
Related posts:
- How to debug Apache RewriteRule or mod_rewrite It’s hard to debug Apache RewriteRule (mod_rewrite) problems, especially when you have multiple rules. With...
- Setup WordPress or WPMU to make an atomic version switch — AND allow you to revert I have a new WordPress MU (WPMU) install and I am ready for my first...

{ 1 comment… read it below or add one }
“Aliases and Redirects are processed in the order they appear in the configuration files, with the first match taking precedence”.
http://httpd.apache.org/docs/2.2/mod/mod_alias.html#order
For mod_rewrite the last match is processed.
SO,
Alias/Redirect – First match wins
RewriteRule – Last match wins
In addition,
Redirect over Alias
Alias before Directory container
Location containers run once before Alias, so Location will apply.