lcp

How To Enable SSL Connection In OpenCart?

First you will have to go to your cPanel -> Let’s Encrypt Certificate.

Once there click on the issue button for the domain on which you have installed OpenCart

After that you will be prompted with the following window and you simply have to click on the Issue button:

Once you have installed it you will have to configure your application to be working with the SSL. There are two ways in which you achieve this.

The first one is that you navigate to your .htaccess file and add the following lines:

RewriteEngine On

RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$ https://domain.com/$1 [R,L]

Where for domain.com you will have to change it to your domain name.

Then click on the blue Save Changed button on the top-right corner.

The Second option that you can use is that you navigate to your cPanel -> File Manager -> public_html (if you have installed the application on your primary domain name).

Once there you have to right-click on the config.php file and select Edit.

Once you click on it you will be redirected to a new tab with the contents of the config.php file and you will see the following lines:

<?php

// HTTP

define(‘HTTP_SERVER’, ‘https://opencart.tmdtutorials.com/’);

// HTTPS

define(‘HTTPS_SERVER’, ‘https://opencart.tmdtutorials.com/’);

Please note that you have set both of the URLs to be with https by default they are set with http. Last but not least you can avoid this process by installing the Let’s Encrypt Certificate (before you have installed the application) and once you continue with the installation you can choose the HTTPS protocol from Softaculous.