Knowledgebase
Webinova Online Customer Support > Webinova Help Desk > Knowledgebase

Search help:


How to access my Joomla admin login by HTTPS if I have a private SSL certificate installed on my account?

Solution

To start accessing your administrator login page via HTTPS you should edit the code of two files in the administrator folder of your Joomla installation.

  • Edit index.php file in the administrator folder of your Joomla installation.

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”);
}
}

  • Edit also index2.php file in the administrator folder of your Joomla installation.

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”);
}
}

If you are not a programmer and you have troubles modifying the code, ask your host for assistance. SiteGround provides the best Joomla hosting and and such requests are completed within minutes.

 
Was this article helpful? yes / no
Article details
Article ID: 323
Category: General Joomla FAQ
Date added: 2012-12-11 15:57:06
Views: 942
Rating (Votes): Article rated 3.2/5.0 (9)

 
« Go back

 
Powered by Help Desk Software HESK - brought to you by Help Desk Software SysAid