Advertisement:

Author Topic: Problem SSL Images  (Read 695 times)

HORTENSIA

  • Jr. Member
  • **
  • Posts: 85
Problem SSL Images
« on: March 17, 2017, 10:45:31 am »
How can I fix this 2 problems:

Failed to load resource: the server responded with a status of 404 ()

(index):1069 Mixed Content: The page at 'https://www.anunturiurgent.ro/' was loaded over HTTPS, but requested an insecure image 'http://www.anunturiurgent.ro/oc-content/themes/modern/images/reclamasimpla/francisc.png'. This content should also be served over HTTPS.

Thanks

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Problem SSL Images
« Reply #1 on: March 17, 2017, 12:56:29 pm »
Hi,

Find in your theme scripts where that image is being invoked and replace "http://" with "//".

Regards

HORTENSIA

  • Jr. Member
  • **
  • Posts: 85
Re: Problem SSL Images
« Reply #2 on: March 17, 2017, 07:13:51 pm »
It is a particular file, you do not know.

Thanks

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Problem SSL Images
« Reply #3 on: March 17, 2017, 07:19:58 pm »
I wouldn't know, looks like a custom image ("reclamasimpla/francisc.png"). ??? You can use Notepad++ / Search / Find in Files to locate that string.

Regards

Athlas

  • Newbie
  • *
  • Posts: 4
Re: Problem SSL Images
« Reply #4 on: October 16, 2018, 10:26:58 am »
Hi,
I have the same problem, I agree with @teseo that need a image invoked, but it's hard to find it because it is not clearly defined in the file.
For example:
in my head.php file stands the line >
Code: [Select]
osc_register_script('images-loaded', osc_current_web_theme_js_url('jquery.imagesloaded.pkgd.min.js'));So, I guess that "jquery.imagesloaded.pkgd.min.js" loads image url , but in that js. script I did not see the way to locate string for replace "http://" with "//"
I am wondering if there is a php code/command for the function.php file that will be say server to serve all image with HTTPS...?

I'm not an expert programmer, but I'm trying to find out logistics solutions.
Another thing, I wonder if the bug is doing some of the Osclass core files, so it can be fixed in the next update...

Cheers !

Athlas

  • Newbie
  • *
  • Posts: 4
Re: Problem SSL Images
« Reply #5 on: October 17, 2018, 11:09:14 am »
SOLVED !

Ok. I found a solution >

In the httaccess. file enter this line on the beginning : 
Code: [Select]
Header set Content-Security-Policy upgrade-insecure-requests;
Explanation >
Code: [Select]
// header
Content-Security-Policy: upgrade-insecure-requests;

// meta tag
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
With the above header set on a domain example.com that wants to migrate from HTTP to HTTPS, non-navigational insecure resource requests are automatically upgraded (first-party as well as third-party requests).

Code: [Select]
<img src="http://example.com/image.png">
<img src="http://not-example.com/image.png">

These URLs will be rewritten before the request is made, meaning that no insecure requests will hit the network. Note that, if the requested resource is not actually available via HTTPS, the request will fail without any fallback to HTTP.

Code: [Select]
<img src="https://example.com/image.png">
<img src="https://not-example.com/image.png">

I hope this will help, Now the mixed content disappeared from my site  :)

davidyan

  • Newbie
  • *
  • Posts: 16
Re: Problem SSL Images
« Reply #6 on: January 12, 2019, 01:46:48 pm »
Hi,
You may also use this
Quote
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
   RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
   RewriteCond %{HTTPS} off
   RewriteRule ^images/.+$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>