Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are WordPress images not showing up with HTTPS?

I'm facing a strange problem with SSL, in fact all my images didn't showing up on SSL, this is an example:

HTTP : http://www.electronique-mixte.fr/wp-content/uploads/2017/06/numidea-logo-electronique-mixte.png

HTTPS : https://www.electronique-mixte.fr/wp-content/uploads/2017/06/numidea-logo-electronique-mixte.png

For the same picture, the HTTP is working, but the HTTPS is not!

Website :

HTTPS no picture is showing up

HTTPS picture 404 error:

enter image description here

HTTP working fine:

enter image description here

Another browser (Edge):

enter image description here PS : I'm using incognito tab (avoid cache)

like image 201
AIT MANSOUR Mohamed Avatar asked May 11 '26 06:05

AIT MANSOUR Mohamed


2 Answers

Because no one else mentioned this: since this is in WordPress (based on the URL structure), make sure your "Site Address" and "WordPress Address" include "https" in the URL:

Be sure to include "https" in your WordPress settings for the "WordPress Address" and "Site Address", otherwise your theme files may try and serve insecure content, thus preventing most browsers from rendering it properly.

Located in Settings > General.

Because WordPress uses these fields to generate image URLs, it's important to include the "https" here, even if you're otherwise redirecting to HTTPS (such as through Apache or Nginx).

like image 162
brons Avatar answered May 14 '26 16:05

brons


Add meta tag in your theme header:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
like image 39
Nikunj Kathrotiya Avatar answered May 14 '26 18:05

Nikunj Kathrotiya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!