How to configure my admin area to be accessible via my private SSL certificate?

In order to access your Joomla'a admin by Private SSL you should make the following changes:

In administrator/index.php, immediately after the line that says

define( '_VALID_MOS', 1);

add the following:

//Redirect to https if accessed over http (except when running locally) if ($_SERVER['SERVER_NAME'] != "localhost")
{
$port = $_SERVER["SERVER_PORT"];
$ssl_port = "443";  //Change 443 to whatever port you use for https (443 is the default and will work in most cases)
if ($port != $ssl_port)
{
$host = $_SERVER["HTTP_HOST"];
$uri = $_SERVER["REQUEST_URI"];
header("Location: https://$host$uri");
}
}

In administrator/index2.php, immediately after the line that says
require_once( '../configuration.php' );
add the same code as above:
//Redirect to https if accessed over http (except when running locally) if ($_SERVER['SERVER_NAME'] != "localhost")
{
$port = $_SERVER["SERVER_PORT"];
$ssl_port = "443";  //Change 443 to whatever port you use for https (443 is the default and will work in most cases)
if ($port != $ssl_port)
{
$host = $_SERVER["HTTP_HOST"];
$uri = $_SERVER["REQUEST_URI"];
header("Location: https://$host$uri");
}
}

These instructions are not suitable for Shared SSL which requires more reconfigurations. Also bear in mind that the above instructions may cause problems and will be overwritten with the next Joomla update.

Joomla is a powerful software that is easy to work with once you have the right host to support you. Before you lose any more time with the wrong host, check out the hostlantern Joomla hosting offer.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to test if jHackGuard is working correctly on your Joomla site?

If you want to be sure that jHackGuard is installed and working correctly on your website, you...

How to remove time stamps from Joomla SEF URLs

Due to an incorrect alias or a non-English character in your category names, Joomla may replace...

How to configure AcyMailing to comply with hostlantern e-mail terms of use?

In order to comply with the SiteGround e-mail Terms of Service you have to configure your...

Joomla caching

The caching mechanism implemented in Joomla is a way to improve the performance and loading speed...

How to extract and restore a Joomla .jpa archive or backup?

Upload your .jpa archive in public_html through your FTP client:...