incubator-pagespeed-mod
incubator-pagespeed-mod copied to clipboard
Images Not Showed
Such as same users in past, some images are not showed on this PrestaShop eCommerce: https://ecosistemigroup.com/it/
I've Ubuntu 16.04 64bit with Apache and I've installed today the latest version today.
I've to disable conversion by jpg to webp, I've solved for various images but not for all..!
Hi The images that don´t show are by 403 Forbiden error, maybe you have some rule in .httaccess that do that. When you run https://ecosistemigroup.com/it/?PageSpeedFilters=`debug , the debug messages in the html code are normal
The PrestaShop .htaccess rules have interference with mod_pagespeed?
Not necesarly. But some thing is blocking these request and the easy response is a .httacces or a firewall rule. I take a closer look and see that headers from the forbiden request are at least curious. A normal image have the header content-type set to some like image/jpg, image/webp and so. But these images have a content-type text/html. When a url is rewrited by pagespeed have some "clues" about it in the headers: etag is set to W/0 or PSA+some string, have a link header to point to the canonical url, an X-Original-Content-Length to show the original size..... But these images don´t have any of these headers, like pagespeed don´t touch it. Even with pagespeed off (https://ecosistemigroup.com/it/?PageSpeed=unplugged) these images don´t load cause a 403 Forbidden error. So the problem is not the pagespeed module, I think.
EDIT: Requesting the image (https://ecosistemigroup.com/img/cms/logo%20per%20mail%20con%20marchio_1.jpg) returns a 403 too
I've solved by adding this code to Apache .conf file:
<Location /img/cms>
<IfModule mod_rewrite.c>
RewriteEngine Off
</IfModule>
</Location>
These module is for rewriting url, you may test that disabling it don´t break the site
Yes.. I've disabled this folder by rewrite and now the mod_pagespeed images rewrite work
@LuigiMdg
In your posted configuration, the line: "RewriteEngine Off" is a misconfiguration, and adding it to your system will not change any system behavior. Why "RewriteEngine Off" is allowed by Apache is that, if you include multiple "RewriteRule" parameters in your configuration, then instead of commenting them all, you can explicitly using “RewriteEngine Off” to disable all "RewriteRule".
More importantly, the default value of “RewriteEngine" is already an "off", so adding “RewriteEngine Off" is quite unnecessary and it may cause confusion to users.
Since herein there is no "RewriteRule", deleting “RewriteEngine Off” would be ideal.
Related Apache source code snippet:
run_rewritemap_programs(server_rec *s , apr_pool_t *p){
if (conf->state == ENGINE_DISABLED) { // usage of "RewriteEngine"
return APR_SUCCESS; // early return
rewritemap_program(...); // usage of "RewriteRule"
}