Switch error from http to https...
anyone know why script that changes url to HTTPS do not work on this template for some of my modules...
find below the script that I placed in the header section of the template layout default.php?? It works fine on native joomla 3x when put in the index.php, but I cant get it to work in Gavern Resturant template..Any Ideas how this might be resolved??
<?php
// SSL received a record that exceeded the maximum permissible length
// check the URL for modules that need SSL
if ((strpos($_SERVER["REQUEST_URI"], "com_dtregister") > 0) || (strpos($_SERVER["REQUEST_URI"], "com_dtdonate") > 0 )|| $_REQUEST['option']=='com_dtdonate' || $_REQUEST['option']=='com_dtregister')
{
// only rewrite the URL once, if you are not in https: mode
if ($_SERVER['SERVER_PORT'] == 80)
{
if($_SERVER['REQUEST_METHOD']=='POST'){
}else{
header( 'Location: https://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
}
}
}
// check to see if https: is not required
if ((strpos($_SERVER["REQUEST_URI"], "com_dtregister") === false) && (strpos($_SERVER["REQUEST_URI"], "com_dtdonate") === false) && $_REQUEST['option']!='com_dtdonate' && $_REQUEST['option']!='com_dtregister')
{
// only rewrite the URL once, if you are already in https: mode
if ($_SERVER['SERVER_PORT'] == 443)
{
if($_SERVER['REQUEST_METHOD']=='POST'){
}else{
header( 'Location: http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
}
}
}
?>