2.13.4.8. Setting up HTTPS in OpenCart
- Check the presence of an installed SSL certificate in SSL settings... If the certificate is missing, install his.
- Edit two config files:
- In file
config.php
hosted in root directory site, find the line with the parameterHTTPS_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/');
- In file
config.php
located in the catalogadmin
, find the lines with parametersHTTPS_SERVER
andHTTPS_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/');
- Enable SSL support in the admin panel of the site itself:
- Openup Adminpanel site.
- Go to section "System → Settings" ("System → Settings").
- To the right of the store name, click "Edit" ("Edit").
- Switch to tab "Server" ("Server").
- Against "SSL Usage" ("Use SSL") select "Yes" ("Yes").
- Save changes by clicking "Save" ("Save") in the upper right corner of the page.
- Turnon redirect to HTTPS.
- 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.