To switch from HTTP to HTTPS for your cPanel login page or your website, you need to ensure that your website has an SSL certificate installed. Once installed, you can force HTTPS to secure your website and the cPanel login.
Here’s how to do it:
Install an SSL Certificate
If you haven’t already, you’ll need to install an SSL certificate for your domain. Many cPanel accounts come with AutoSSL enabled, which automatically installs a free SSL certificate. Here’s how to check:
Log into your cPanel.
Look for the Security section and click on SSL/TLS.
Under Manage SSL Sites, check if your domain has an SSL certificate installed.
If not, you can install it via AutoSSL (this is typically handled automatically by your hosting provider).
Force HTTPS in cPanel
To make sure all traffic (including your cPanel login) uses HTTPS, follow these steps:
Log in to cPanel.
Scroll down to the Domains section and click on Redirects.
Under Add Redirect, select Permanent (301) as the type.
From the http://(www.)? drop-down menu, select your domain.
In the Redirects to field, type the https:// version of your domain.
Select the option Only redirect with www. or Redirect with and without www., depending on your preference.
Make sure the Wild Card Redirect option is unchecked.
Force HTTPS in .htaccess (Optional but Recommended)
You can also force all traffic to use HTTPS by adding a few lines to your .htaccess file in the root directory of your website.
Go to File Manager in cPanel and navigate to the root directory of your site.
Open the .htaccess file (or create one if it doesn’t exist).
Add the following code at the top of the file:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
This will automatically redirect all HTTP traffic to HTTPS on your website.
Forcing HTTPS on cPanel Login:
If you want to ensure that your cPanel login uses HTTPS, you can simply visit https://yourdomain.com/cpanel or https://cpanel.yourdomain.com. If SSL is properly configured for your domain, cPanel should load securely over HTTPS.