I have a problem with Drupal's original .htaccess file. If i put this file into my apache docroot ( / ) for clean URL-s, i cannot reach the apache statistic page (ExtendedStatus On). From localhost -> http://mydomain/server-status -> I get "page not found" message. If i remove .htaccess file, i can reach the page.

Suspected lines are:

# Rewrite current-style URLs of the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

If i uncomment these lines, my problem is gone.

Any idea? Workaround?

Thanks.

Comments

FFred’s picture

I'm interested in this as well...

I've been looking into it to get the munin Apache module working (munin polls the server-status URL) but Drupal replies with a 404. Haven't found a way around it yet.

geofs’s picture

I had the same problem and looked at: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

I just added a line about /server-status

  # Rewrite current-style URLs of the form 'index.php?q=x'.
  RewriteCond %{REQUEST_URI} !=/server-status
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
nerdcore’s picture

Can anyone suggest a method by which this could be added within Apache's VirtualHost or Directory stanzas, so that if someone else on my team pulls the entire DRUPAL_ROOT across from a development server we don't lose this one addition to .htaccess (happened this weekend ;) ?

alpeshbhavsar’s picture

I have applied below rule in .htaccess and it worked.

RewriteRule ^(server-info|server-status) - [L]

rickumali’s picture

Thank you for this post (over six years later)! This helped me with enabling munin to work on my Drupal site. Per the later comments, it does mean I have to be very careful to remember the .htaccess when I move between environments, or when I upgrade Drupal.

geerlingguy’s picture

This does work well for those using Munin or some other monitoring tool with Apache-backed Drupal; one other possible solution would be to set up your virtualhosts so you have a separate local virtualhost (like localhost or whatever.dev) that you can use from the server itself (or call from a monitoring tool on a separate server) to call that URL, without having to change the .htaccess file.

__________________
Personal site: www.jeffgeerling.com

q7joey’s picture

you can fix this in the global http.conf by adding a quick:

Alias /server-status /var/www/html

along with the normal tag. the alias overrides .htaccess processing

q7joey’s picture

looks like that causes apache to want a trailing slash, so it sends a 301 redirect, which a browser is happy with, but zenoss is not, and munin might be the same way. still digging.

q7joey’s picture

just make an empty file somewhere the server allows access, i used /var/www/dummy and then:

Alias /server-status /var/www/dummy

now things are happy.

dasginganinja’s picture

+1

I just wanted to thank you for sharing this.

yasheshb’s picture

worked for me too. thank you.

Yashesh Bhatia