Mixed Content error caused by CSS file

Hello!
In some browsers I get a Mixed Content error because there’s a call for style.css file and that file will be supposedly loading via HTTP protocol and that’s what some browsers try to prevent. It’s this line that triggers the error. And on line 46 in a source code of main page you see this:

<link rel="stylesheet" href="css:style.css" />

I assume that something within a template attempts to load that insecure CSS file (which I’m not even sure that exists in my Joomla tree). I don’t know where to find the source of this call and how to stop it. POSSIBLY it’s in templates/jp-x2/layouts/template.config.php file on line 103 there’s this:

$this['asset']->addFile('css', 'css:style.css');

So MAYBE it’s the source of the trouble (or maybe not!)
Here how it looks like in Chromium browser (under Ubuntu 16.04) after pressing F12

As a matter of fact, I’ve just got a reply from the template dev. He advised me to create an empty css/custom.css and the issue will be done. Now the question is how to create that so that it would be served over HTTPS.
Also is it OK that I would be creating a file with a name “Custom.css” whereas the call is for “Style.css”?

I’m not sure how that would work, but try creating the file as he says and see if it works. Remember though that custom.css and Custom.css are not the same thing.

It should not matter what you call your CSS file, as long as you are linking to the correct URL.

I am puzzled by this, it does not look like a normal URL to a style sheet.
On the actual site, the link does not lead anywhere. So you could probably remove the line that creates it, or change it to a CSS resource that does exist.

UPDATE
I created a file called style.css and placed it in a CSS folder of my current template and it solved the issue! I actually created that CSS file inside backend of Joomla in its “Template Manager - New File” section. The problem is solved!

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.