Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Images With Https Path Rate Topic   - - - - -

 
  • Mirco
  • Advanced Member
  • Trial users
  • Join Date: 11-Mar 13
  • 59 posts

Posted 27 August 2015 - 01:36 PM #1

Hi,

 

Just curious.

Could someone explain why cs-cart is alway inserting the images with the total path:

https://www.site.com...mages/image.jpginstead of a relative path like /images/image.jpg ?

This makes a lot of unneeded https requests to the server when visiting a 'normal' page.

 

regards, Mirco

 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11400 posts

Posted 27 August 2015 - 09:21 PM #2

Are you saying that you always get https image paths even when the address bar shows http?

The proper way to provide a relative path in today's browsers is //path/file.suffix.  The '//' tells the browser to use whatever the active protocol of the page is for doing a GET of those items.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • deep4life
  • Newbie
  • Trial users
  • Join Date: 16-Feb 15
  • 2 posts

Posted 03 May 2016 - 04:54 PM #3

Hi tbirnseth,

 

can you please explain where I can change the setting absolute paths to relative paths for images? Because I have the same problem.

 

Thanks in advance!

 

Best,

Dzan



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11400 posts

Posted 04 May 2016 - 07:58 PM #4

As with many cs-cart functions, there is more than one.  You need to review the functions in app/functions/fn.images.php for which ones you want to make relative and which to remain as FQDN (fully qualified domain name) references.  I.e. for an email, you would want a FQDN and for a browser you would want a relative path (with leading '//').  But cs-cart should already account for whether the browser is using SSL or not and use https as the protocol instead of http in that case so that you don't see the 'insecure content' warning on https pages.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.