Disable mod_pagespeed (no server conf access, .htaccess doesn't work)

假装没事ソ 提交于 2020-04-07 14:13:33

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!