![](/img/trans.png)
[英].htacces redirect from example.com/abc to https://www.example.com/abc
[英]redirect http://www.example.com/ to https://www.example.com/ with htaccess
我正在用它作為解決方案。
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
但是我一直收到這個錯誤。 “並非頁面的所有版本都指向相同的URL。” 僅包含' http://www.example.com/的URL不會重定向到'https',而是正確地保留所有重定向。
你可以喜歡
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.