[英].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.