Php 将http更改为https后opencart管理员不工作
我是opencart的新手。我想在opencart中启用Php 将http更改为https后opencart管理员不工作,php,.htaccess,ssl,opencart,Php,.htaccess,Ssl,Opencart,我是opencart的新手。我想在opencart中启用SSL。 所以我试图更改以下文件 config.php文件更改 // HTTP define('HTTP_SERVER', 'http://example.com/'); // HTTPS define('HTTPS_SERVER', 'https://example.com/'); // HTTP define('HTTP_SERVER', 'http://example.com/admin/'); define('HTTP_CATA
SSL
。
所以我试图更改以下文件
config.php
文件更改
// HTTP
define('HTTP_SERVER', 'http://example.com/');
// HTTPS
define('HTTPS_SERVER', 'https://example.com/');
// HTTP
define('HTTP_SERVER', 'http://example.com/admin/');
define('HTTP_CATALOG', 'http://example.com/');
// HTTPS
define('HTTPS_SERVER', 'https://example.com/admin/');
define('HTTPS_CATALOG', 'https://example.com/');
admin/config.php
文件更改
// HTTP
define('HTTP_SERVER', 'http://example.com/');
// HTTPS
define('HTTPS_SERVER', 'https://example.com/');
// HTTP
define('HTTP_SERVER', 'http://example.com/admin/');
define('HTTP_CATALOG', 'http://example.com/');
// HTTPS
define('HTTPS_SERVER', 'https://example.com/admin/');
define('HTTPS_CATALOG', 'https://example.com/');
system/library/url.php
文件更改(第16行)
.htaccess
将更改放在代码后面
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
管理面板更改`设置>服务器>使用SSL设置是'
在进行上述更改后,我无法登录管理面板不会显示任何错误消息。您错过了管理url的https。 在
admin/config.php
define('HTTPS_SERVER', 'http://example.com/admin/');
define('HTTPS_CATALOG', 'http://example.com/');
到
转到根文件夹单击系统,然后转到配置,突出显示admin.php,并对其进行编辑…确保站点ssl为真以使整个站点ssl成为趋势(如在amazon.co.uk等上),并提供一点SEO提升。我必须将http_服务器设置为https。除此之外: OpenCart 1.5的https 在设置/系统/服务器中打开 检查admin/config.pgp和config.php是否设置了正确的SSL url 在config.php中设置http_服务器设置-通常应该是http。当设置为https时,似乎会对其进行排序 在config.php中,我现在有了
<?php
// HTTP
define('HTTP_SERVER', 'https://www.example.com/');
很容易解决此问题。在system/library/url.php中
改变
if ($connection == 'NONSSL') {
$url = $this->url;
} else {
$url = $this->ssl;
}
到
这将强制所有链接使用https在管理页面中创建新的.htaccess文件,其中仅包含以下代码:
RewriteBase /
在root和admin文件夹中编辑config.php文件,以指向https URL和.htaccess文件
也在system/config目录中
分别为2个文件:
admin.php(用于管理后端)
发现
换成
$_['site_ssl'] = true;
与catalog.php文件相同(用于前端)前端页面一切正常吗?是,但管理员登录不可能显示管理员登录页面,其表单操作具有https url?另外,请告诉我们您更改的原因:system/library/url.php文件更改(第16行)
。谢谢您最后的建议。登录表单操作没有https url,但我尝试在它完成工作后手动替换。如何从操作url更改?我从某处得到了解决方案,这就是为什么我尝试在url.php
中更改。尝试将管理员和前端的所有配置文件url更改为https。
$_['site_ssl'] = false;
$_['site_ssl'] = true;