Image loading issues after moving to HTTPS

43 views
Skip to first unread message

Tim

unread,
Mar 26, 2017, 8:14:27 PM3/26/17
to mod-pagespeed-discuss
Hello,

Recently I have installed an SSL certificate in some of my sites, but I'm facing some problems. For example in https://bestlistofporn.com there is some images that aren't loading...

I think is related with mod_pagespeed. Can someone give me some help?

I have read

I added below line on 'pagespeed.conf' to fix the issue with the domain bestlistofporn.com
--
[root@server conf]# grep bestlistofporn /usr/local/apache/conf/pagespeed.conf 
ModPagespeedMapOriginDomain http://localhost https://bestlistofporn.com
[root@server conf]#

But it didn't help...
At first load is opening fine, but after a while (probably due to cache cleaning) returns to the same issue. What could be?

For example, the logo image code that isnt loading:

Lots of errors in console:

Everything was working great on http://

I hope someone can help me with this :)

Waiting for your replies, thanks!

Kind Regards,
Tim

Otto van der Schaaf

unread,
Mar 27, 2017, 3:51:24 AM3/27/17
to mod-pagespeed-discuss
The resources seem to be loading OK now, did you change something in the configuration?

Otto

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/0d4e053c-aeac-40c0-9d7c-10aa6aa9e5bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tim

unread,
Mar 27, 2017, 6:32:28 AM3/27/17
to mod-pagespeed-discuss
Hello Otto,

Thank you for your reply and for trying to help me.
The problem is that, sometimes loads fine, sometimes it doesn't.
For example, right now is not loading some images again...

Do you have any suggestion how to fix this?
My  pagespeed.cfg file: http://paste2.org/OPzBmwJn

Thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Otto van der Schaaf

unread,
Mar 27, 2017, 7:12:21 AM3/27/17
to mod-pagespeed-discuss
I think the problem is that your have a MapOriginDomain that makes mod_pagespeed fetch https from http instead.
But http in turn seems to redirect back to https, so this won't work (even if mod_pagespeed would understand and follow redirects today).
Instead of mapping https to http, maybe you could use https fetching, or set up loading static files directly from disk?


Otto

To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/09004a25-e032-473e-9c31-d9029fc9c281%40googlegroups.com.

Tim

unread,
Mar 27, 2017, 8:03:27 AM3/27/17
to mod-pagespeed-discuss
Hey again Otto,

For redirect, I added this to my htaccess:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Could be a issue with my htaccess file?
http://paste2.org/4Ia8bpyZ

What line do you suggest to add on pagespeed.cfg? This one?
ModPagespeedFetchHttps enable

But it says:
"HTTPS fetching is built in and is enabled by default as of 1.10.33.0."
Isn't enabled already?

This one too?
ModPagespeedLoadFromFile "https://bestlistofporn.com" "/var/www/bestlistofporn/static/";


Thank you once again for trying to help me.

Kind Regards,
Tim
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Otto van der Schaaf

unread,
Mar 27, 2017, 2:39:13 PM3/27/17
to mod-pagespeed-discuss
Support for https fetching should be enabled indeed with the version your site is running. 

If https fetching somehow isn't working well for you, MapOriginDomain and LoadFromFile may provide workarounds.
I was assuming https fetching did not work well for you, because you added the MapOriginDomain line to map https to http.
But that won't work because you have set the server up to redirect http to https (which is fine).

You could try https fetching (which I think just means removing the MapOriginDomain line, and removing the LoadFromFile line), and see how that works out.
Alternatively, you could try LoadFromFile, but make sure you only map static files that you want exposed to the public with it:

Otto


To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/d251d3ef-fc92-430e-adcb-37a56f49ffba%40googlegroups.com.

Tim

unread,
Mar 27, 2017, 4:38:21 PM3/27/17
to mod-pagespeed-discuss
Hello Otto,

I already added:
--
ModPagespeedFetchHttps enable
--

And removed:
--
--

But it seems that didn't worked :/

Btw, I have this in my htaccess:

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# BEGIN W3TC Page Cache core
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} =on
    RewriteRule .* - [E=W3TC_SSL:_ssl]
    RewriteCond %{SERVER_PORT} =443
    RewriteRule .* - [E=W3TC_SSL:_ssl]
    RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
    RewriteRule .* - [E=W3TC_PREVIEW:_preview]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} =""
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html" -f
    RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html" [L]
</IfModule>
# END W3TC Page Cache core

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Is the 2nd line correct?
RewriteCond %{HTTPS} off

I'm using W3 Total Cache and the plugin added the line below:
RewriteCond %{HTTPS} =on


Are you familiar with this rules?

So the only thing that is left for me is LoadFromFile right?
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Joshua Marantz

unread,
Mar 27, 2017, 4:43:19 PM3/27/17
to mod-pagespeed-discuss
If LoadFromFile works for your setup, and your files are on a local, physical disk, I recommend it strongly.  If your files are on a network-mounted disk, then I think your system will behave better if you can fetch them via http(s).


To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Tim

unread,
Mar 27, 2017, 4:48:46 PM3/27/17
to mod-pagespeed-discuss
Hello jmarantz,

Thank you for your reply and for trying to help me.
How can I fetch them via http(s)? Whats the code line?

Otto, are you familiar with wordpress?
Can you help me and give me the lines needed to make it work with static files?

Thank you guys!
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/d251d3ef-fc92-430e-adcb-37a56f49ffba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tim

unread,
Mar 27, 2017, 7:40:04 PM3/27/17
to mod-pagespeed-discuss
Otto, you said:

Alternatively, you could try LoadFromFile, but make sure you only map static files that you want exposed to the public with it:
https://modpagespeed.com/doc/domains#limiting-load-from-file

What do I need to do with a wordpress website?
Can you help me and give me the lines needed to make it work with static files?

Thanks!

Otto van der Schaaf

unread,
Mar 28, 2017, 4:44:28 AM3/28/17
to mod-pagesp...@googlegroups.com
For WordPress, a search for "wordpress modpagespeedloadfromfile" shows up examples, maybe 
they can provide a good starting point?

Otto

To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/6ab00acf-65dc-4a0e-8190-031a5f97f137%40googlegroups.com.

Tim

unread,
Mar 28, 2017, 5:37:30 AM3/28/17
to mod-pagespeed-discuss
Yeah I did that as well, but there is so many different examples.
Between this options, what you think that offers best results?

What do you think about this one?

--
ModPagespeedLoadFromFile https://domain.com/ /home/username/public_html/
ModPagespeedLoadFromFileRuleMatch disallow .*$
ModPagespeedLoadFromFileRuleMatch allow \.css$
ModPagespeedLoadFromFileRuleMatch allow \.js$
ModPagespeedLoadFromFileRuleMatch allow \.gif$
ModPagespeedLoadFromFileRuleMatch allow \.png$
ModPagespeedLoadFromFileRuleMatch allow \.jpg$
--

Thanks! :)
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages