最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

database - How to convert srcset links from https to http?

programmeradmin0浏览0评论

After trying SSL and having some unfortunate problem with it, I decide to go back to HTTP. Everything seems find, by the srcset attribute of <img> tag is still https everywhere.

This post Wordpress: srcset gets HTTP instead of HTTPS in all posts asks for the opposite direction, but still provides me guides to diagnose. However:

  1. In wp-includes > media.php, I can find the wp_calculate_image_srcset method, but unable to find these two lines:

    $image_baseurl = _wp_upload_dir_baseurl();
    $image_baseurl = trailingslashit( $image_baseurl ) . $dirname;
    
  2. In wp_options table, both home and siteurl already have http values.

I also delete all cache. Still no help.

What else do I need to check? Here is my page: quảcầu.

After trying SSL and having some unfortunate problem with it, I decide to go back to HTTP. Everything seems find, by the srcset attribute of <img> tag is still https everywhere.

This post Wordpress: srcset gets HTTP instead of HTTPS in all posts asks for the opposite direction, but still provides me guides to diagnose. However:

  1. In wp-includes > media.php, I can find the wp_calculate_image_srcset method, but unable to find these two lines:

    $image_baseurl = _wp_upload_dir_baseurl();
    $image_baseurl = trailingslashit( $image_baseurl ) . $dirname;
    
  2. In wp_options table, both home and siteurl already have http values.

I also delete all cache. Still no help.

What else do I need to check? Here is my page: quảcầu.

Share Improve this question edited Feb 19, 2020 at 9:00 Johansson 15.4k11 gold badges43 silver badges79 bronze badges asked Aug 21, 2019 at 10:56 OokerOoker 3324 silver badges23 bronze badges 3
  • 2 Those srcset images are coming from Jetpack. So you need to turn off Photon from Jetpack to serve images on HTTP and from your own server. Not sure why would you revert all of this, when you might end up adding https all over again. – Kumar Commented Aug 21, 2019 at 11:10
  • thanks. If you make that an answer I'll accept it. Anyway, I wonder what is the point of that feature, if all it does is change the link from HTTP to HTTPS. And the reason I do that is because my server somehow blocking access of Facebook bot. See What makes Open Graph checkers unable to detect Open Graph data? - Let's Encrypt Community Support – Ooker Commented Aug 21, 2019 at 13:14
  • I'll post it as answer and about your other question I'd need to go through it later. – Kumar Commented Aug 21, 2019 at 14:22
Add a comment  | 

1 Answer 1

Reset to default 1

@Ooker It's the Jetpack that is serving you the images on https. If you'd turn off the Photon add-on from Jetpack you should be able to get images served over http from your own server.

Also if you turn off Photon, images won't be served from CDN anymore, so you might have to figure that out.

发布评论

评论列表(0)

  1. 暂无评论