Today a short snippet how to force SSL / HTTPS and www. prefix in front of URLs:
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#webksde#JP20140227: Always HTTPS!
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]