Htaccess手动插入链接不起作用

时间:2017-07-06 05:41:55

标签: php .htaccess opencart

我已经编辑了我的htaccess文件以进行https重定向。但是当我们手动编写enter image description here时,它会重定向到https://domainname.com/fashion

我的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 ^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 [R=301, L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTPS} ^www\. [NC]
RewriteRule (.*) https://domainname.com%{REQUEST_URI} [R=301, L]

请帮忙。

1 个答案:

答案 0 :(得分:0)

从索引规则

中删除R标记
RewriteRule ^([^?]*) index.php?_route_=$1 [L]

将https重定向移至顶部

RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteCond %{HTTPS} ^www\. [NC]
RewriteRule (.*) https://domainname.com%{REQUEST_URI} [R=301, L]
...
相关问题