{php}
############################################################################
# Instructions:
# 1) Add this entire script to your header.tpl file, make sure you include
# the {php} and {/php} tags that you see above and below.
# 2) Change $domain to your non ssl area domain name.
# 3) Change $ssldomain to your ssl enabled domain.
#
# Script provided free by Mark Chaney (aka MACscr) mchaney@maximhosting.com
############################################################################
$domain = "support.domain.com"; //no trailing slash
$ssldomain = "secure.domain.com"; //no trailing slash
############## Do Not edit below unless you know what your doing ############
$filename = $_SERVER['PHP_SELF'];
$newfilename = str_replace("/", "", $filename);
if ($newfilename == "order.php" || $newfilename == "clientarea.php") {
if (!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on' ) {
header ('Location: https://'.$ssldomain.$_SERVER['REQUEST_URI']);
exit();
}
}else{
if ($_SERVER['HTTP_HOST'] == $ssldomain || isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'on' ) {
header ('Location: http://'.$domain.$_SERVER['REQUEST_URI']);
exit();
}
}
{/php}