Background images causing insecure warning over https

Permalink
I've tried every fix I can find in the forums.

Changing my theme path in the header to this:

<link rel="stylesheet" href="<? echo $this->getThemePath()?>/css/main.css"/>


Adding the following to my my site.php file:

if (!defined('BASE_URL')) { 
   if(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) {
      define('BASE_URL', 'https://' . $_SERVER['HTTP_HOST']);
   } else {
      define('BASE_URL', 'http://' . $_SERVER['HTTP_HOST']);
   }
}


Nothing works, Anybody run into this issue and find a fix? I'm running C5 5.5 and ecommerce 2.5

thanks.

 
mkly replied on at Permalink Reply
mkly
Do you know which one is the offending image(s)? It's most definitely in main.css. The way I deal with this is find the url() in the css and do this
.something {
  background: url('https://example.com/themes/mytheme/images/background.png');
}

The point being to use the quotes. Then you can still use
$this->getStyleSheet()

If you want.
You can also override the background css in your header.php with a style tag like this
<style>
.something {
  background: url('https://example.com/themes/mytheme/images/background.png');
}
</style>

if you put that after the main.css stylesheet reference.
dotman replied on at Permalink Reply
I tried both your methods. the first just appended on the https address to the http address for the 2 bg images noted below.

The second just makes my bg images dissapear on every page. i also stop getting warnings in FF, but continue to in chrome. So frustrating. I must be missing something simple.

These are actually the css rules that call 2 bg images in main.css:

[code}
body {
font-size: 12pt;
line-height: 1.75em;
font-family: Georgia, serif;
background: #ad8667 url('images/bg.jpg');
color: #ebe1d9;
}

#bg {
background: url('images/shadow.png') top left repeat-x;
}

[/code]
mkly replied on at Permalink Reply
mkly
I'm sorry, you have to put the full path including the https like
url('https://example.com/my/path/to/image/background.png');

Not the relative path.
Phallanx replied on at Permalink Reply
Phallanx
If you leave off the protocol, it will use whatever is appropriate (if I remember correctly).
e.g.

url('//example.com/my/path/to/image/background.png');
dotman replied on at Permalink Reply
sorry, i did put the full path with https and single quotes, I accidentally pasted the old rules.

But actually, I had munged the path, so that's why the images weren't showing, so it looks like it worked.

I don't get security warnings in IE or FF, but I do in Chrome. Not sure why. maybe a cache problem?

Now if only I can get my warnings back for wrong discount codes, shipping etc, I should be set.

they show up fine on my local server, but no warning during checkout on the remote. I don't think I changed anything, so not sure where to look.

If you're familiar with the ecom add on and have any suggestions, really appreciate it.

thanks for all your help.
mkly replied on at Permalink Reply
mkly
You can put this in header.php below the main.css
<?php if(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')): ?>
body {
  background: #ad8667 url('https:/<?php echo $this->getThemePath() ?>/images/bg.jpg');
}
$bg {
  background: url('https:/<?php echo $this->getThemePath() ?>/images/bg.jpg');
}
<?php endif; ?>
dotman replied on at Permalink Reply
interesting. I will try that as well. very good to know if it works.

thanks.
ideasponge replied on at Permalink Reply
ideasponge
I have this same problem but it isn't my files referenced in the css, it is the actually link to the css and JS files that concrete5 generates. How do I make it so that c5 loads all of it's css and js files using whatever protocol is used(http/https)?