I\'m trying to redirect all insecure HTTP requests on my site (e.g. http://www.example.com) to HTTPS (https://www.example.com). I\'m using PHP btw.
http://www.example.com
https://www.example.com
I found out that the best way for https and www on domain is
RewriteCond %{HTTPS} off RewriteCond %{HTTPS_HOST} !^www.example.com$ [NC] RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]