Apache server-status – Allow localhost only

To prevent wordpress from trying to serve the server-status page

local .htaccess file :

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# rewrite rule for server-status to prevent 404 error
RewriteCond %{REQUEST_URI} !=/server-status

RewriteRule . /index.php [L]

# END WordPress

To enable local access in the server-status config

/etc/apache2/mods-available/status.conf :

<Location /server-status>
	SetHandler server-status

	Order Deny,Allow
	Deny from all
	Allow from localhost


Leave a Reply

%d bloggers like this: