Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2009
    Posts
    11
    Plugin Contributions
    0

    Default Issues with Relative Images - Store vs. SSL Checkout

    Hi all! New Zenner here and I'm not very PHP savvy. I have a question about using relative image links in my code. I apologize that this post will be long winded, but I want to make sure you know every step I've taken so far.

    I recently changed the store's configure.php file so that the checkout process would run on a secure server. Here's what I have in the configure.php file:

    Code:
    // Define the webserver and path parameters
      // HTTP_SERVER is your Main webserver: eg, http://www.yourdomain.com
      // HTTPS_SERVER is your Secure webserver: eg, https://www.yourdomain.com
      define('HTTP_SERVER', 'http://store.mydomain.com');
      define('HTTPS_SERVER', 'https://secure.bluehost.com/~mydomain/store');
    
      // Use secure webserver for checkout procedure?
      define('ENABLE_SSL', 'true');
    
    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
      // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
      define('DIR_WS_CATALOG', '/');
      define('DIR_WS_HTTPS_CATALOG', '/');
    I had placed absolute linked images in the tpl_header.php file to customize the look of the header. But when the customer gets to the checkout process, the browser's security report would say that some of the information on the page was not secure. Sooo, I changed the tpl_header.php code to use relative images, like this:

    Code:
    <img src="../images/my-header.png" />
    This works fine on the unsecured pages, but once you get to the checkout screen, the images are broken because the website is trying to pull the image from the following location:

    Code:
    https://secure.bluehost.com/~mydomain/images/my-header.png
    Which doesn't exist. The store is actually in a directory. BUT, I can't have the SRC say "/store/images/myheader.png" because the root is the subdomain (I'm only using this host for subdomains). So on the checkout page the image would show up, but on the unsecured pages it would pull the image from "http://store.mydomain.com/store/images/myheader.png."

    My solution was placing absolute image links in the tpl_header.php file TO the secure server, like so:

    Code:
    <img src="https://secure.bluehost.com/~mydomain/store/images/my-header.png" />
    Now the images load fine across the board, and there are no security report issues, but it's slower this way, and just seems like a silly way of doing things in general.

    In short (too late), how might I place images in tpl_header.php file without screwing up the security report on the checkout pages, or having the secure pages point to images that don't exist?

    Any suggestions? I'm actually hoping that I'm just an idiot and am missing something so simple, so easy... Maybe there's a way to write it in PHP instead of straight HTML that would get the images to load on unsecured and secured pages alike... Alas, I have no idea how to write it...

    Thanks to anyone who made it to the bottom of this post! :)

  2. #2
    Join Date
    Jun 2003
    Posts
    33,720
    Plugin Contributions
    0

    Default Re: Issues with Relative Images - Store vs. SSL Checkout

    Which images directory is the image in?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Nov 2009
    Posts
    11
    Plugin Contributions
    0

    Default Re: Issues with Relative Images - Store vs. SSL Checkout

    Weeeell, technically the images are in two locations. :)

    I'd like the images to be in the "includes/templates/my_template/images" folder, so I can keep them separate... But somewhere along my path of troubleshooting I thought maybe this was the problem, so I uploaded copies of the images to the root's images/ folder.

  4. #4
    Join Date
    Jun 2003
    Posts
    33,720
    Plugin Contributions
    0

    Default Re: Issues with Relative Images - Store vs. SSL Checkout

    If they are all in the templates - then use:

    <img src="includes/templates/my_template/images/MY_IMAGE.gif" />
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  5. #5
    Join Date
    Nov 2009
    Posts
    11
    Plugin Contributions
    0

    Default Re: Issues with Relative Images - Store vs. SSL Checkout

    You are a Godsend. :)

    It worked! And it was so EASY. Thank you!

  6. #6
    Join Date
    Jan 2011
    Posts
    19
    Plugin Contributions
    0

    image problem Re: Issues with Relative Images - Store vs. SSL Checkout

    Hi,

    Sorry to dig up an old thread but I have a similar image/ssl issue however it is not just my header image as was the issue above, none of my cart images are loading in the secure checkout (unless I select "No" to the question of do I only want to view the secure items).

    It also appears that my css is not loading either when I go to checkout. Looks like I'm missing or have the wrong path in some file but I don't know where.

    Any help would be greatly appreciated.

    Thank you,

    Brian

 

 

Similar Threads

  1. Relative path to images
    By NoHug4u in forum Basic Configuration
    Replies: 8
    Last Post: 28 Dec 2012, 03:28 PM
  2. Product Images with Relative Links
    By mattgoldfarb in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 31 Mar 2011, 12:47 AM
  3. IE/Firefox absolute relative position issues (with javascript)
    By ranger_lp in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 28 Nov 2008, 08:31 PM
  4. Issues with SSL
    By jsiegmund in forum Managing Customers and Orders
    Replies: 4
    Last Post: 8 Jan 2008, 02:57 PM

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