|
Run administration on HTTPS |
|
|
|
Sunday, 08 January 2006 |
|
Is there an easy way to get th administration to run on secure environment (https)?
Add the following code to your administrator/index.php file ( after define( '_VALID_MOS', 1 ); ) // See if user is connecting via SSL
if ($_SERVER["SERVER_PORT"] == "443" && $_SERVER['SERVER_NAME'] != "localhost")
{
// reset site config var to SSL equiv
$mosConfig_live_site = $mosConfig_live_site_SSL;
}
if ($_SERVER['SERVER_NAME'] != "localhost")
{
$host = $_SERVER["HTTP_HOST"];
$uri = $_SERVER["REQUEST_URI"];
$port = $_SERVER["SERVER_PORT"];
$ssl_port = "443";
if ($port != $ssl_port)
{
header("Location: https://$host$uri");
}
} |