关于如何让OPENCART 使用 SSL证书

Enabling SSL in the OpenCart Dashboard

  1. Log into the OpenCart Dashboard
  2. Go to System > Settings
  3. Click on the Server tab
  4. Check the radio button to use SSL

Enabling SSL in the OpenCart directory config.php file

  1. Log into cPanel and go to File Manager
  2. Navigate to your OpenCart installation directory
  3. Open (Edit or Code Editor) the configuration file (config.php)
  4. 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/’);

  5. 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/’);

  6. Save changes and close the config.php file

Enabling SSL in the OpenCart Admin folder config.php file

  1. Go to the “Admin” folder
  2. Open (Edit or Code Editor) the configuration file (config.php)
  3. 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/’);

  4. 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/’);

  5. Save changes and close the config.php file

    设置htacess让首页直接跳转生效


    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [R=301,L]

  6. 补充有些认不到的需要加入:define(‘HTTPS_SERVER’, ‘https://’.$_SERVER[‘SERVER_NAME’].’/’); 替换

Comments

发表回复

Your email address will not be published. Name and email are required