Hi,
In case of more websites, I have the best experience with this solution:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
The first condition checks, if www. is included in URL. When www. is not present, it will redirect to https://www.
The second rule should be applied, if www. is included, but URL does not start with https://.