ModPagespeed off command no longer works in .htaccess

monkey64

Well-Known Member
Nov 6, 2011
121
5
68
cPanel Access Level
Root Administrator
I'm running WHM v96.09 along with Mod PageSpeed version 1.14.36.1-2.2.4.cpanel, originally installed via EasyApache 4.
There are several sites which I prevent the module from running on using the following code in the root .htaccess file (as referenced at the bottom of this WHM page).
Below is my full .htaccess file (see the 'IfModule pagespeed_module' line). I've not made any recent changes:

Code:
Options +FollowSymLinks
RewriteEngine on

ErrorDocument 401 default

RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$

SetOutputFilter DEFLATE
Header unset ETag
FileETag None

ExpiresActive On
ExpiresDefault "access plus 1 month"

# 1 MONTH
<filesMatch "\.(js|css|jpg|jpeg|png|gif)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>

# No need for the .php extension
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ $1.php

# All URLs should be secure HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://mysite.com/$1 [R=301,L]

<IfModule pagespeed_module>
ModPagespeed off
</IfModule>

AuthType Basic
AuthName "Mysite"
AuthUserFile "/home/mysite/.htpasswds/public_html/passwd"
require valid-user

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
This has always worked perfectly, that is until this morning. Now the 'ModPagespeed off' command in each domain's .htaccess file has no effect and Mod Pagespeed is running on all sites. Have restarted Apache + PHP-FPM but it didn't help.

Does anyone have any ideas?
 
Last edited:

cPJustinD

Administrator
Staff member
Jan 12, 2021
286
51
103
Houston
cPanel Access Level
Root Administrator

monkey64

Well-Known Member
Nov 6, 2011
121
5
68
cPanel Access Level
Root Administrator
Hi cPJustinD

PHP-FPM was indeed disabled, thanks for the heads-up.
I ran the scripts and the previous FPM customizations came across with the exception of one domain. I managed to figure out the settings easily enough. All domains are running PHP-FPM now.

So that's one problem out the way but the .htaccess file still has no effect and Mod Pagespeed is running on all sites (i.e I can't disable per domain via .htaccess).
Do you have any further ideas?
 

cPJustinD

Administrator
Staff member
Jan 12, 2021
286
51
103
Houston
cPanel Access Level
Root Administrator
To be honest, I don't see any issues with the syntax used as it appears to be correct per https://www.modpagespeed.com/doc/configuration, and I'm not aware of any other recent changes that would affect the pagespeed module

I think it would be best to open a support ticket so that our analysts can review the issue more thoroughly and determine what exactly is occurring. You can submit a support request using the "Submit a ticket" link in my signature below.

Please be sure to link this thread when opening the ticket and provide the ticket number here so that we can track the issue appropriately. If possible, please post the resolution on this thread as it may help other community members with similar issues.
 

monkey64

Well-Known Member
Nov 6, 2011
121
5
68
cPanel Access Level
Root Administrator
This was quite a strange issue...
Going to MultiPHP Manager -> User Domain Settings, making a change and clicking update was enough to get this working again. I did also restart Apache + PHP-FPM for good measure. I thought I tried that earlier, but anyway I got it working :)
 
  • Like
Reactions: cPJustinD