Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have this virtual host setup as the first in a list of virtual hosts. It is

<VirtualHost localhost:80>
ServerName localhost
DocumentRoot "/www/drupal5"

<Location /server-status>
    SetHandler server-status
    Order Deny,Allow
    Allow from localhost
</Location>
</VirtualHost>

The rest of the virtual hosts are below and expressed as *:80.

When I include the DocumentRoot in this virtual host, requests on the server to http://localhost/server-status always hit /index.php through rewrite rules in /www/drupal5/.htaccess. If I remove the DocumentRoot declaration, /server-status requests work fine, but then the site isn't available at all at http://localhost/.

How can I get http://localhost/server-status to work as well as the site to load at http://localhost/ ?

share|improve this question
Can you post the contents of /www/drupal5/.htaccess? Hopefully, it is possible to modify the rewrite rules so that requests for /server-status are not rewritten. – Steven Monday Oct 23 '10 at 1:19
The clarification I think I need is: is it possible for mod_rewrite to overwrite what happens to a /server-status path even though it's been handled in the <Location> – user58003 Oct 23 '10 at 1:29

1 Answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.