我有一个安装了开放式购物车的域,我的网站上也有SSL。如果有人通过http://www.example.com/pageseo
它们会自动重定向到
https://www.example.com/index.php路由=页面seo
我们怎样才能摆脱这个index.php路线=请告知?
这是我的.htaccess代码。
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www'.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
您需要转到目录system/library
,在文件response.php
中找到带有public function output()
的行,然后插入:
if (!defined('HTTP_CATALOG')) $this->output = str_replace('index.php?route=common/home', '', $this->output);
添加到你的.htaccess文件下一个:
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
你可以试试这个,还没有用Opencart测试过,但它在其他地方也能工作。
RewriteCond %{HTTP_HOST} ^example'.com$ [OR]
RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]