我正在寻找一种强制SSL和的方法www。
我已经能够分别强迫两者,但是在一起我一直遇到重定向问题。下面的代码在处理这种格式的URL时起作用:http://example.com并正确地重定向到,https://www.example.com但是当传入的URL https://example.com不会转发到https://www.example.com-有任何建议吗?
编辑:它也应该发送http://www.example.com给https://www.example.com。
RewriteCond %{REMOTE_ADDR} !127\.0\.0\.0
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} !^www.example\.com$
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]