I am getting 404s for rewritten resources when using Mod_Pagespeed

The most common reason that the rewritten resources 404 is because of mod_rewrite RewriteCond rules. For example:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /404 [L,R=301]

This rule causes 404 for all requests which don't exist on the filesystem, including mod_pagespeed rewritten resources.

In order to fix this you must add an exception for mod_pagespeed URLs:

RewriteCond %{REQUEST_URI} !pagespeed

This will allow rewritten resources, the admin console and static resources necessary for some filters.


  • 0 Users Found This Useful
Was this answer helpful?

Couldn't find what you are looking for?

Related Articles

PageSpeed broke my site; what do I do?

First of all, sorry about that. The Pagespeed team put a lot of work into validating the...

PageSpeed causes my page to display an XML Parsing Error message

This usually happens when using a content management or generation system (we've seen it with...

How to I enable Mod_PageSeed on my CPanel hosting account?

We have Google's PageSpeed module installed on every web hosting account but it is turned off by...