Reputation: 720
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.).
Upvotes: 33
Views: 72302
Reputation:
I had the same issue with my WordPress website, I had installed it on Google Cloud, and by default, the Application installed pagespeed mod for apache. But I found the solution on the Bitnami documentation page.
Check If PageSpeed Is Enabled
execute the command or edit conf file using FTP:
nano /opt/bitnami/apache2/conf/httpd.conf
And if you find these two lines:
Include conf/pagespeed.conf
Include conf/pagespeed_libraries.conf
That means pagespeed mod is enabled.
For Disable PageSpeed
execute the same command or edit conf file using FTP:
nano /opt/bitnami/apache2/conf/httpd.conf
Comment out the following lines as below:
#Include conf/pagespeed.conf
#Include conf/pagespeed_libraries.conf
Now restart the apache server
sudo /opt/bitnami/ctlscript.sh restart apache
Note:- As above mentioned, the command and the directory location would be changed depending on the Apache server location or your deployment application.
For a detailed article, check out the official Bitnami WordPress Documentation.
Upvotes: 1
Reputation: 5257
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.
Upvotes: 8
Reputation: 461
Create a .htaccess
file, add below text and upload using ftp program. We are also a hosting provider and use Pagespeed.
Modpagespeed Off
Upvotes: 46
Reputation: 166
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.
Upvotes: 5