I don't know what to do about this and I claim no expertise in .htaccess rewrite rules so if someone knows how to work around this please help.

With Drupal installed (apache 2.2.22 / php 5.4.9) trying to navigate to any of these paths throws a "500 Internal Server Error". If I remove the drupal folder altogether from the webroot directory, the pagespeed statistics page is shown.

PS: This is an already known issue with many CMSes and pagespeed out there, but so far the official stance of pagespeed developers is that it is the responsibility of each respective CMS to provide a solution:

Issue 597: Can't access to the stats pages other than from localhost

Comments

jonbob’s picture

The issue here is that Drupal's mod_rewrite rules conflict with these special mod_pagespeed paths. As a workaround, you can add directives to .htaccess that prevent these paths from being rewritten. Insert the following lines after the RewriteBase directive and before the subsequent RewriteCond:

RewriteRule /mod_pagespeed_statistics - [L]
RewriteRule /pagespeed_console - [L]
RewriteRule /mod_pagespeed_message - [L]

This seems too specific a solution to include in Drupal itself, but it's a fine workaround for a specific site.

klonos’s picture

Thanx for the suggestion - it worked like a charm. How about if we included this wrapped in an IfModule so that it loads conditionally?:

<IfModule pagespeed_module>
  RewriteRule /mod_pagespeed_statistics - [L]
  RewriteRule /pagespeed_console - [L]
  RewriteRule /mod_pagespeed_message - [L]
</IfModule>

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.