[ic] Force external image links to inherit page security

Paul Jordan paul at gishnetwork.com
Wed Dec 5 19:03:29 UTC 2012

I am working on a system where I need to host images - mostly product 
images, in the cloud.

Is there a (built in) mechanism to write plain ole http:// src's to the 
page, but have the page sense if it is being requested via https, and 
exchange any 'http' with 'https'?  Or, is there perhaps a method to declare 
a variable twice, once for http requests and once for https requests? If so, 
then I could do:

S3_IMAGES    http://.....    https://.....    Cloud product images

I realize I can use ImageDir and ImageDirSecure, but these are only singular 
solutions. I need to leverage a couple of these (as if I we're using 
multiple clouds). Obviously I can do a bunch of If-Secure-Else in all my 
pages, but I was hoping for something more elegant.

Or if nothing else, has anyone needed to use multiple external asset hosts 
and deliver the same page(s) via http and https?  What did you come up with?

Worst case scenario, I can poor man it:

    [if type="explicit" compare="[is-secure]"]
        [tmpn ssl]s[tmpn]
        [tmpn ssl][tmpn]

<img src="http[scratch ssl]://foo.bar.jpg" />

But... that seems like the old me :-)


More information about the interchange-users mailing list