我安装了opencart最新版本,我想为url启用所有ssl
在管理集中启用SSL
在config.php中,管理和类别都更改为https。
htaccess
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]但是,当url不是SEO时,它会工作,所以url与SEO一起工作,它不工作,url将是=台式机/mac。
发布于 2016-06-27 05:09:54
我还安装了opencart 2.2。
我尝试了https的扩展名,但是它破坏了一切;
我找到了一个可行的解决方案3步:
··1··在.htaccess中:在末尾添加
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} store
RewriteRule ^(.*)$ https://www.__your_domain__.com/store/$1 [R,L]··2···
在根+ admin中的config.php中
<?php
// HTTP
define('HTTP_SERVER', 'https://www.__your_domain__.com/store/');
// HTTPS
define('HTTPS_SERVER', 'https://www.__your_domain__.com/store/');*即使在浏览器中使用https://也是不够的.在源中的每个链接中,http:// .*所以我找到了最后一步
·3··在系统/库/url中将http修改为https和voilà:)
public function link($route, $args = '', $secure = false) {
if ($this->ssl && $secure) {
$url = 'https://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route;
} else {
$url = 'https://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route;
}发布于 2016-06-23 16:22:46
我只是花了一整晚让它起作用,希望它能帮到别人。我目前有一个带有SSL/https的Opencart 2.2,可用于所有页面。(好烂,多烦人)..我正在使用Fastor的主题,并有SEO,vQMOD,和其他几个mods和扩展。
下面是我所做的工作: 1.安装v2.2.0.x Changes.zip 不将VQMOD更新为2.6.1 (杀死我的安装)不安装VQMODManager3.0(也杀死了我的安装)。手动安装就行了。如果你需要的话可以用谷歌搜索。
区块报价
#SEO URL Settings
RewriteEngine On
#If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=302]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [QSA]
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=302,L]区块报价
config.php
// HTTP
define('HTTP_SERVER', 'https://www.example.com/');
// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/');
admin/config.php
// HTTP
define('HTTP_SERVER', 'https://www.example.com/admin/');
define('HTTP_CATALOG', 'https://www.example.com/');
// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/admin/');
define('HTTPS_CATALOG', 'https://www.example.com/');我所做的其他手动修复:Currency/Currency Fix 货币/货币“修正”不适合我。如果货币兑换商破坏了您的SSL,您可以尝试修复或删除它,方法是删除view/ currency /currency.tpl中的所有代码。做一个备份,然后空出代码。
没有加载图片/CSS的尝试这个修复:我还手动提交了这个修复程序,不知道v2.2.0 Changes.zip是否得到了这个修复:
区块报价
SEO/SSL cant load page
Open catalog/controller/startup/startup.php
and after
$this->config->set('config_url', HTTP_SERVER);
add
$this->config->set('config_ssl', HTTPS_SERVER);发布于 2016-03-31 12:06:31
你换了管理员吗?在管理面板>设置>安全启用使用SSL
https://stackoverflow.com/questions/36272499
复制相似问题