After long break caused by my relocation to another country I would like to get back on track with my blog postings. I hope that you will find them being fresh and interesting.
Recently while working on our newest product for Malcolm Delaney I came across interesting issue. As you know I am a big performance nut so here at LowGravity we are using mod_pagespeed – “an open-source webserver module automatically applies web performance best practices” (official site of PageSpeed at Google Developers website). I would say that “automatically” is a big word, but it helps a lot in improving pages performance. We are paying a lot of attention to performance optimization during development process and PageSpeed allows us to squeeze 20-25% more of our product performance.
While development I have totally switched off PageSpeed caching to not interfere with my workflow (sometimes PageSpeed tends to keep the cache for too long). Unfortunately after switching the module on I got weird issues so I tried to play with module settings and disable particular PageSpeed filters.
Because this module is very extensive and has lots of various filters Google gave us statistics page which shows filters usage. You can access this page by visiting domain.com/mod_pagespeed_statistics . Unfortunately this interferes with WordPress mod_rewrite rules which are placed in .htaccess file located in root of our webdirectory causing misconfiguration server errors (500) because of too many internal redirects.
This situation can be avoided by editing .htaccess and adding new rules above WordPress block:
RewriteRule /mod_pagespeed_statistics - [L]
# BEGIN WordPress
... wordpress rules here ...
– [L] rule means that mod_rewrite should leave url untouched and do not process any other rules which are below (this means that if the rule matches, no further rules will be processed).
You can use this solution to exclude any other locations which resides “inside” WordPress installation from being processed by mod_rewrite (of course by adjusting rules accordingly to your needs).
P.S. Please do not forget to allow yourself to access mod_pagespeed_statistics URL by editing pagespeed.conf file.