Enabling SSL in the OpenCart Dashboard
- Log into the OpenCart Dashboard
- Go to System > Settings
- Click on the Server tab
- Check the radio button to use SSL
Enabling SSL in the OpenCart directory config.php file
- Log into cPanel and go to File Manager
- Navigate to your OpenCart installation directory
- Open (Edit or Code Editor) the configuration file (config.php)
- Look for the lines below // HTTPS that looks similar to this:
define(‘HTTPS_SERVER’, ‘http://opencart.inmotiontesting.com/’);
define(‘HTTPS_IMAGE’, ‘http://opencart.inmotiontesting.com/image/’); - Edit the HTTPS settings to reflect your SSL URL path. For example:
define(‘HTTPS_SERVER’, ‘https://opencart.inmotiontesting.com/’);
define(‘HTTPS_IMAGE’, ‘https://opencart.inmotiontesting.com/image/’); - Save changes and close the config.php file
Enabling SSL in the OpenCart Admin folder config.php file
- Go to the “Admin” folder
- Open (Edit or Code Editor) the configuration file (config.php)
- Look for the lines below // HTTPS that looks similar to this:
define(‘HTTPS_SERVER’, ‘http://opencart.inmotiontesting.com/admin/’);
define(‘HTTPS_CATALOG’, ‘http://opencart.inmotiontesting.com/’);
define(‘HTTPS_IMAGE’, ‘http://opencart.inmotiontesting.com/image/’); - Edit the HTTPS settings to reflect your SSL URL path. For example:
define(‘HTTPS_SERVER’, ‘https://opencart.inmotiontesting.com/admin/’);
define(‘HTTPS_CATALOG’, ‘https://opencart.inmotiontesting.com/’);
define(‘HTTPS_IMAGE’, ‘https://opencart.inmotiontesting.com/image/’); - Save changes and close the config.php file
设置htacess让首页直接跳转生效
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [R=301,L] - 补充有些认不到的需要加入:define(‘HTTPS_SERVER’, ‘https://’.$_SERVER[‘SERVER_NAME’].’/’); 替换
Comments