.htaccess不会重定向到https版本

时间:2018-12-18 12:20:27

标签: .htaccess apache2

我正在尝试的是:

RewriteEngine on

RewriteCond %{HTTP_HOST} !=""
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS} ^on(s)|
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

杜曼http://example.comhttps://example.com均有效。第一个应该重定向到安全版本。我究竟做错了什么 ?我看了看周围的许多文章,但无法解决问题。谢谢!

0 个答案:

没有答案
相关问题