Setting up HTTPS in OpenCart

  1. Check the presence of an installed SSL certificate in SSL settings... If the certificate is missing, install his.
  2. Edit two config files:
    1. In file config.phphosted in root directory site, find the line with the parameter HTTPS_SERVER:
      // HTTPS
      define('HTTPS_SERVER', 'http://example.com/');

      Replace the HTTP address specified in it with HTTPS so that it looks like this:

      // HTTPS
      define('HTTPS_SERVER', 'https://example.com/');
    2. In file config.phplocated in the catalog admin, find the lines with parameters HTTPS_SERVER and HTTPS_CATALOG:
      // HTTPS
      define('HTTPS_SERVER', 'http://example.com/admin/');
      define('HTTPS_CATALOG', 'http://example.com/');

      Replace the HTTP addresses listed in them with HTTPS, so that in the end they look like this:

      // HTTPS
      define('HTTPS_SERVER', 'https://example.com/admin/');
      define('HTTPS_CATALOG', 'https://example.com/');
  3. Enable SSL support in the admin panel of the site itself:
    1. Openup Adminpanel site.
    2. Go to section "System → Settings" ("System → Settings").
    3. To the right of the store name, click "Edit" ("Edit").
    4. Switch to tab "Server" ("Server").
    5. Against "SSL Usage" ("Use SSL") select "Yes" ("Yes").
    6. Save changes by clicking "Save" ("Save") in the upper right corner of the page.
  4. Turnon redirect to HTTPS.
  5. Check the site is working.

In most cases, the described actions are enough for the site to work over HTTPS.

If you are using OpenCart 2.2 and the steps described are not enough, try using this instruction.