Getting apache mod_status and mod_info to play nicely with wordpress…..

After reading many (too many) posts about this subject that did not work, I finally found a way to get this working. If you have a wordpress site setup you will, at some point during the installation, be told to copy a bunch of “redirect” code to your .htaccess file in your wordpress installation folder. These apache redirects take care of making pretty URL’s and permalinks amongst other things. The problem is that these .htaccess rules in wordpress take over server-info and server-status urls activated in apache’s config and return a page not found error.

I came across numerous sites that suggested adding a rule like:

RewriteCond %{REQUEST_URI} !=/server-status

This didn’t work for me. I’m not sure if the multisite version of wordpress (which I’m using) is causing this. The rule that worked beautifully is the following:

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

This rule stops the rewrite engine whenever server-info or server-status is parsed as part of the URL. So my .htaccess looks like this now:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Stop Processing if you see server-info or server-status
RewriteRule ^(server-info|server-status) - [L]
# The Rewrite Condition below did not work
# RewriteCond %{REQUEST_URI} !=/server-status
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . index.php [L]
# END WordPress

2 responses to “Getting apache mod_status and mod_info to play nicely with wordpress…..”

Leave a Reply