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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Apache2 server with various virtual servers running. For SEO purposes, anything that does not match is automatically redirected to

RewriteCond %{HTTP_HOST} !^www\.mydomain\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

This is working fine but I want to monitor status of the apache server by calling http://localhost/server-status?auto

The problem is that this is redirecting to which is not a valid URL. What additional redirect can I add to avoid this problem? Or is there some other way this can be tackled?

share|improve this question


RewriteCond %{REQUEST_URI} !=/server-status
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]
share|improve this answer
Thank you for the answer. But this didn't help me. The issue was a bit of complication with DocumentRoot pointing to /var/www/mydomain, access rights for /server-status location (Allow from instead of Allow from localhost) and then adding a special virtual host for localhost. – sayeed Feb 27 '11 at 13:17

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.