Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hello.

I am working on a website hosted by 000webhost and using cloudflare for the ssl certificate.

I'm having a problem with webp images not displaying over https connection.

I found the reason to be that <cms:show k_site_link /> gives http inside <source> tags, even though everywhere else in the code it gives https.

Here is a code snippet to give a better idea:
Code: Select all
<picture>
    <source srcset="http://sendi-solar.com//images/solar-power-company.webp" type="image/webp">
    <source srcset="http://sendi-solar.com//images/solar-power-company.jpg" type="image/jpeg">
    <img id="cover-img" src="https://sendi-solar.com//images/solar-power-company.jpg" alt="" class="img-fluid">
</picture>

^This is the generated html code.

While in the php file it is like this:
Code: Select all
<picture>
    <source srcset="<cms:show k_site_link />images/logo-sendi-solar.webp" type="image/webp">
    <source srcset="<cms:show k_site_link />images/logo-sendi-solar.png" type="image/png">
    <img src="<cms:show k_site_link />images/logo-sendi-solar.png" alt="Sendi-solar" height="100%" width="200">
</picture>

I don't understand what is causing the <cms:show k_site_link /> to behave like that.

For context, I have hotlink protection in cloudflare turned off.
Does the setting in config.php have the https? :)
Do you mean this setting?

Code: Select all
// 1.
// If necessary, define the full URL of your site including the subdomain, if any.
// V.IMP: Don't forget the trailing slash!
// define( 'K_SITE_URL', 'https://www.sendi-solar.com/' );


I tried to use it, but then my page doesn't get redirected to the host.
This one, for instance, has missing "www": https://sendi-solar.com/couch/uploads/f ... flare.webp

I visited your page and the source code has https:// All webps are loaded fine I checked the network tab in browser and webps are loaded with or without 'www' e.g.. https://www.sendi-solar.com/images/logo ... solar.webp
Also there is something wrong with your webp background image, it's 2.5 mb which is ridiculous. https://sendi-solar.com/couch/uploads/f ... flare.webp

Try to reconvert it from source again, because I tried with AVIF and it turned out only 190 kb.

Attachments

Turns out my problem was as simple as changing cloudflare encryption mode to full. Now all pages load images properly.

I hadn't noticed the 2.5mb webp file though, I'll fix it right away. Thanks for bringing it to my attention.
6 posts Page 1 of 1
cron