Skip to main content

In this guide, we’ll learn how to force SSL on your Epik cPanel-based hosting.

Forcing SSL consist of the procedures we can take to redirect all HTTP requests to HTTPS. This means every single page and file in your hosting will be downloaded through a secure connection instead, making sure both your website files and your users’ information are safe from malicious agents.

If you’ve set up your application through Installatron, it’s important your website is installed in the https:// directory. You can select this option in the Location section of the Advanced tab in your Installatron Applications through your cPanel dashboard.

We’ll learn of two ways of setting forced SSL redirection on the cPanel – through the Domain options, and through the .htaccess file.

Force SSL through cPanel Domain options

1. First, log in to your cPanel hosting – you learn how to access your cPanel in this article.

2. In your cPanel Dashboard, click Domains under Domains.

3. Here, find your Primary or Main Domain that has the Document Root of public_html. Toggle the option Force HTTPS Redirect to ON. Do this for other secondary domains if available. The toggle is applied automatically, so no need to save.

4. Test by navigating to your website after clearing the browser’s cache.

Force SSL through .htaccess file

1. In your cPanel Dashboard, click File Manager under Files.

2. Navigate to the website’s directory – public_html (or the secondary domain folder).

3. Click Settings in the top right corner, and in the Preferences window, check the option Show Hidden Files and Save.

4. Now you should see the .htaccess file in the directory. Right-click it and select Edit.

5. In the editing page, we’re looking for the “RewriteEngine On” line. At the end of that statement, add the following code (replacing yourdomain with your website domain name):

RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

6. Save the file and test your website after clearing cache and cookies.