mod_pagespeed : Exclude some directory using htaccess

Me7888 picture Me7888 · Mar 11, 2014 · Viewed 10.5k times · Source

How can exclude some directory for mod_pagespeed using htaccess rules....

note : I am required to disable only some directory not all files and folders

Answer

sligocki picture sligocki · Mar 12, 2014

You can simply set ModPagespeed off in an .htaccess file. This will disable all rewiting of HTML in that directory. It will not stop mod_pagespeed from rewriting images/CSS/JS in that directory.

To disable rewriting of all HTML and resources, you can add ModPagespeedDisallow http://www.example.com/subdir/* anywhere in your config. See documentation for more info. Note that this requires you to specify the entire URL, not just a relative path.