我已经编辑了我的htaccess文件以进行https重定向。但是当我们手动编写时,它会重定向到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]
请帮忙。
答案 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]
...