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


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");
}
}
  • joomla, ssl
  • 65 Users Found This Useful
Was this answer helpful?

Related Articles

Can I change the domain name my SSL Certificate is issued for?

Unfortunately, for security reasons, if a SSL certificate has already been issued, the domain...

What is SSL (Secure Sockets Layer)?

SSL (Secure Sockets Layer) is a protocol designed by Netscape Communications to enable encrypted,...

Why do my pages load more slowly when I use SSL?

SSL pages are slower because of the overhead needed to encrypt and decrypt the data. The web...

Why do I get the message 'some items are insecure'?

For a server to serve a page securely all items, including graphics, must be accessed using the...

Install and generate a Private Key for SSL Certificates with DirectAdmin

This section covers: Certificate installation requirements How to use the server's shared...