Forums/Community Forums/Developer Discussion Forum

Answered

Creating a Secure PHP Template for HTTPS

Nate Baker
asked this on November 23, 2010 00:29

To make a secure PHP template, just prepend any asset links (images,
stylesheets, javascript, etc) with the below:

<?php echo $content_xml->secure_image_url ?>

For example, to get a secure link for a stylesheet:

<link href="/styles.css" rel="stylesheet" type="text/css" />

becomes

<link href="<?php echo $content_xml->secure_image_url ?>/styles.css"
rel="stylesheet" type="text/css" />

The secure_image_url XML only displays when a secure request is made,
so if it's not a secure page, nothing is displayed, and it keeps the
request relative.

Originally posted in the Sitemason Developers Google Group on Wed, 21 Apr 2010