How to setup secure connection to your Opencart-based website


Websites can be viewed through http and https protocols. You may notice this prefix in any URL like this:

image
But some efforts and resources are required to offer displaying a website through https. First of all you have to install an SSL certificate to your domain. This point is usually covered by your hosting and all questions about SSL installation can be addressed to hosting support team.

Let's assume that you have a domain that may show a website through https. But sometimes it shows warnings like "your website is not fully secured". To fix that you need to tell Opencart to use https for all URLs. It can be done by defining https URLs in two config files.
  • config.php
  • admin/config.php
In these files find two lines where HTTP_SERVER and HTTPS_SERVER constants are defined and replace their URLs with links to https locations like this:

// HTTP
define('HTTP_SERVER', 'https://www.example.com/');

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/');
where www.example.com is your website name.

Please Wait!

Please wait... it will take a second!