.htaccesspagespeedmod-pagespeed

mod_pagespeed : Exclude some directory using htaccess


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


Solution

  • 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.