使OpenCart 2.2安装100%HTTPS

使OpenCart 2.2安装100%HTTPS,opencart,opencart2.x,Opencart,Opencart2.x,我今天刚刚在我的网站上安装了OpenCart 2.2,运行在Apache服务器上,运行PHP 7.0.8版 该网站已经安装了SSL证书,我可以通过以下方式访问购物目录: https://example.com/printshop/index.php 我希望整个安装程序都在SSL上运行,因此我对相关配置文件进行了如下编辑: // HTTP define('HTTP_SERVER', 'https://example.com/printshop/'); // HTTPS define('HTT

我今天刚刚在我的网站上安装了OpenCart 2.2,运行在Apache服务器上,运行PHP 7.0.8版

该网站已经安装了SSL证书,我可以通过以下方式访问购物目录:

https://example.com/printshop/index.php
我希望整个安装程序都在SSL上运行,因此我对相关配置文件进行了如下编辑:

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

// HTTPS
define('HTTPS_SERVER', 'https://example.com/printshop/');
// HTTP
define('HTTP_SERVER', 'https://example.com/printshop/admin/');
define('HTTP_CATALOG', 'https://example.com/printshop/');

// HTTPS
define('HTTPS_SERVER', 'https://example.com/printshop/admin/');
define('HTTPS_CATALOG', 'https://example.com/printshop/');

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

// HTTPS
define('HTTPS_SERVER', 'https://example.com/printshop/');
// HTTP
define('HTTP_SERVER', 'https://example.com/printshop/admin/');
define('HTTP_CATALOG', 'https://example.com/printshop/');

// HTTPS
define('HTTPS_SERVER', 'https://example.com/printshop/admin/');
define('HTTPS_CATALOG', 'https://example.com/printshop/');
我遇到的问题是页面不是100%安全的,因为表单操作指向一个不安全的URL-例如

<form action="http://example.com/printshop/index.php?route=common/currency/currency" method="post" enctype="multipart/form-data" id="form-currency">
致:

另外,请确保更新安装根目录中的config.php,并将admin/config.php指向https。

s

控制器文件上有以下代码

$this->url->link('common/home');
你需要传递最后两个参数,比如

$this->url->link('common/home','',true);
最后两个参数用于SSL

如果您需要检查它的代码。然后得到系统->库->Url.php文件

默认的$secure参数为false

您将使默认值$secure parameter=true,或使控制器文件上的最后一个参数为true

$this->url->link('common/home');
希望这对您有所帮助。

s

控制器文件上有以下代码

$this->url->link('common/home');
你需要传递最后两个参数,比如

$this->url->link('common/home','',true);
最后两个参数用于SSL

如果您需要检查它的代码。然后得到系统->库->Url.php文件

默认的$secure参数为false

您将使默认值$secure parameter=true,或使控制器文件上的最后一个参数为true

$this->url->link('common/home');

希望这对您有所帮助。

谢谢@Vipul Jethva。我已经按照建议编辑了url.php文件,这似乎解决了一些问题,但是如果我转到管理登录页面,甚至转到,表单操作仍然指向http而不是https。我需要在这里编辑一些东西吗:admin/controller/common/login.php我能看到的只是
$data['action']=$this->url->link('common/login','',true)已设置为true,不是吗?谢谢你将在系统->图书馆->网址上使用https。仅当条件具有https时。所以你也可以在其他条件下使用https。谢谢@Vipul Jethva。我已经按照建议编辑了url.php文件,这似乎解决了一些问题,但是如果我转到管理登录页面,甚至转到,表单操作仍然指向http而不是https。我需要在这里编辑一些东西吗:admin/controller/common/login.php我能看到的只是
$data['action']=$this->url->link('common/login','',true)已设置为true,不是吗?谢谢你将在系统->图书馆->网址上使用https。仅当条件具有https时。因此,您还将在其他条件下使用https。