htaccess redirect all traffic to https://www
<p>I'm trying to redirect three cases to <a href="https://www">https://www</a>. They are:</p>

<p><code>http://</code><br>
<code>http://www</code><br>
<code>https://</code>  </p>

<p>I've been able to get the first two, but not the last one. Here's what I'm using for that:</p>

<p><code>RewriteCond %{HTTPS} off</code><br>
<code>RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]</code><br>
<code>RewriteRule (.*) https://www.%1%{REQUEST_URI} [L,R=301]</code></p>