I want to redirect 301:
http://example.com
http://www.example.com
TO
https://www.example.com
I put this code, but it does not work (error 500)
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ https://www.example.com/%{REQUEST_URI} [R=301,L, NE]