How can I use DocumentRoot and server-status within an Apache virtual host?

Found the solution when I googled 'server-status mod_rewrite'. Coincidentally it was answered in a drupal forum: http://drupal.org/node/52511

Adding RewriteCond %{REQUEST_URI} !=/server-status to the rewrite rule for redirecting all traffic to /index.php fixed it.

Very confusing that mod_rewrite can rewrite a uri that's already set a handler.


Just add a blank vhost entry to the top of the vhost configuration file e.g.

<VirtualHost *:80>
</VirtualHost>

If you're using Apache 2.3 or higher, you should also be able to use the END flag in your VirtualHost entry, to save having to modify the .htaccess files.

RewriteCond %{REQUEST_URI} /server-status
RewriteRule ^ - [END]

Should prevent the subsequent rules from rewriting things.