问题
I have a Wordpress site that my client wants to validate perfectly (using W3C validator). One of the issues is Google's pagespeed, which seems to be enabled by default by hosting provider.
I try to disable mod_pagespeed in .htaccess file with the following, but it doesn't work for some reason:
<IfModule pagespeed_module>
ModPagespeed off
</IfModule>
I can disable it by adding "?ModPagespeed=off" to URL, but this does not solve my problem.
Is there anything else I can try? I only have access via FTP (no server conf access, no c-panel access, etc.).
回答1:
Which hosting provider? Can you make sure your server is Apache rather than nginx? nginx doesn't support .htaccess files, though the PageSpeed module is otherwise very similar in function.
Also check out the 'pedantic' filter: https://developers.google.com/speed/pagespeed/module/filter-pedantic, which let's you get all the speed & bandwidth benefits of PageSpeed but still have a validation-clean site.
回答2:
Create a .htaccess
file, add below text and upload using ftp program. We are also a hosting provider and use Pagespeed.
Modpagespeed Off
回答3:
Your URL can accept the PageSpeed
query-paramter with an off
or on
value.
http://www.example.com/index.html?PageSpeed=off
or
http://www.example.com/index.html?q=foo&PageSpeed=off
more here.
来源:https://stackoverflow.com/questions/20798911/disable-mod-pagespeed-no-server-conf-access-htaccess-doesnt-work