Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,065
    Plugin Contributions
    0

    Default Background images not showing on https pages

    I've looked at this thread

    https://www.zen-cart.com/showthread....ckground+image

    and checked that hotlinking protection is turned off on my server control panel.

    My background images are coded like this

    Code:
    body {margin: 0;background: #444 url(../images/bk.png) repeat-x;font-family: 'Arial';font-size: 72.5%;color: #444;}
    and I get a page not found when trying to view the background image in a browser.

    Any ideas? the https page is at http://urlgone.com/4658d5/ (you'll have to skip the ad that comes up I'm afraid) and there should be a black band behind the mega menu as there is on the home page

  2. #2
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,065
    Plugin Contributions
    0

    Default Re: Background images not showing on https pages

    It looks like it might be to do with the css minifier I have turned on - turning it off breaks the template. Time for a closer look.

  3. #3
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,762
    Plugin Contributions
    9

    Default Re: Background images not showing on https pages

    Link broken - no style(css)
    My background images are coded like this
    I assume that this is in your stylesheet???

    You might try taking out the shorthand and fully coding it more correctly like
    Code:
            background-image: url(../images/header_bg.jpg);
    	background-repeat: repeat-x;
    	background-color: #444;
    	height:75px;
            font: arial;
            font-size; 72.5%;
            font-color; #444;
    Zen-Venom Get Bitten

  4. #4
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,065
    Plugin Contributions
    0

    Default Re: Background images not showing on https pages

    Yes sorry, I had to disable SSL while I took a break - it's back on for the time being.

    Yes, that code was in my stylesheet. Changing it to

    Code:
    body 
    {
    margin: 0;
    background-image: url(../images/bk.png);
    background-repeat: repeat-x;
    background-color: #444;
    font-family: 'Arial';
    font-size: 72.5%;
    color: #444;}
    had no effect.

    What seems to be happening; on https pages the path to 'normal' images is:

    h t t p s://supersonic.accountservergroup.com/~myaccountname/mywebsite.co.uk/includes/templates/mytemplate/images/image.png

    Whereas the path to background images is:

    h t t p s://supersonic.accountservergroup.com/includes/templates/mytemplate/images/image.png

    So it seems to be related to the fact I'm using a shared SSL from my hosting company as the /~myaccountname/mywebsite.co.uk is getting stripped from the background-image url.

    If I change the css to

    Code:
    body 
    {
    margin: 0;
    background-image: url(https://supersonic.accountservergroup.com/~myaccountname/mywebsite.co.uk/includes/templates/mytemplate/images/bk.png);
    background-repeat: repeat-x;
    background-color: #444;
    font-family: 'Arial';
    font-size: 72.5%;
    color: #444;}
    Then all's well. However hard coding the background images to the https version doesn't seem ideal. Perhaps there's something I can do to my configure.php although I doubt it.

    I wonder if anyone else using a shared SSL is having the same problem with background images?
    Last edited by simon1066; 24 Jul 2015 at 07:54 AM.

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    11,377
    Plugin Contributions
    80

    Default Re: Background images not showing on https pages

    It sounds like you're already using the CSS/JS Loader. Please verify, one of my sites used to use shared SSL and I had the same issue, solvable via a conditional CSS/JS autoload.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,481
    Plugin Contributions
    17

    Default Re: Background images not showing on https pages

    Your thought on modifying your configure.php files is on target. Ideally, DIR_WS_HTTP and the HTTPS equivalent are the same, with the remaining content in HTTP_SERVER and the HTTPS equivalent. This should have been performed by the install/upgrade process. Sorry, long day and I don't recall the specific constants at the moment.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    11,377
    Plugin Contributions
    80

    Default Re: Background images not showing on https pages

    Quote Originally Posted by mc12345678 View Post
    Your thought on modifying your configure.php files is on target. Ideally, DIR_WS_HTTP and the HTTPS equivalent are the same, with the remaining content in HTTP_SERVER and the HTTPS equivalent. This should have been performed by the install/upgrade process. Sorry, long day and I don't recall the specific constants at the moment.
    FWIW, this is not something that can be corrected via a change to the configure.php files. The issue is that there are images referenced via CSS that are no longer accessible when running under the shared-SSL path.

  8. #8
    Join Date
    Jul 2012
    Posts
    16,481
    Plugin Contributions
    17

    Default Re: Background images not showing on https pages

    Quote Originally Posted by lat9 View Post
    It sounds like you're already using the CSS/JS Loader. Please verify, one of my sites used to use shared SSL and I had the same issue, solvable via a conditional CSS/JS autoload.
    Or I could be completely wrong.

    Didn't copy the additional text, but that was something I was thinking about/wondering and trying to figure out how was "directly" tied in... (Not so direct.)
    Last edited by mc12345678; 24 Jul 2015 at 03:18 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,065
    Plugin Contributions
    0

    Default Re: Background images not showing on https pages

    Quote Originally Posted by lat9 View Post
    It sounds like you're already using the CSS/JS Loader. Please verify, one of my sites used to use shared SSL and I had the same issue, solvable via a conditional CSS/JS autoload.
    Sorry it took so long to get back.

    Yes, I am using the CSS/JS Loader v3.0.5. What would the conditional autoload need to load?

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    11,377
    Plugin Contributions
    80

    Default Re: Background images not showing on https pages

    You'll need two file changes. First, create the https_images.css file that contains only the image-related references, with those references based on your shared-SSL server, for example:
    Code:
    body {background-image: url(https://supersonic.accountservergroup.com/~myaccountname/mywebsite.co.uk/includes/templates/mytemplate/images/bk.png);}
    Then, update one of files (or create a new file) in /includes/templates/YOUR_TEMPLATE/auto_loaders to contain:
    Code:
    if ($request_type == 'SSL') {
      $loaders[] = array('conditions'    => array('pages' => array ('*')),
                         'css_files'     => array('https_images.css' => 20002),
                        );
    }
    Leave your normal stylesheet alone, picking up the images using the ../images notation. That path to the files will be picked up on non-SSL accesses.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Templage Images not showing up on secure pages....
    By BlackOrchidCouture in forum General Questions
    Replies: 3
    Last Post: 19 Oct 2010, 07:14 PM
  2. Images not showing in HTTPS
    By DarrenQ in forum General Questions
    Replies: 15
    Last Post: 20 Jun 2010, 03:30 AM
  3. Images on product pages not showing
    By TzuLady in forum General Questions
    Replies: 2
    Last Post: 15 Apr 2010, 09:06 AM
  4. Images showing as http on https
    By IDW in forum General Questions
    Replies: 6
    Last Post: 12 Apr 2010, 02:36 AM
  5. Images not showing when customer use HTTPS
    By mmambou in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 May 2009, 09:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR