title: htaccess rewrite to require www, https, and ip
body: <p>I am trying to figure out how to write the .htaccess so that all URLs:
  1) Use https
  2) Forward from <a href="http://example.com" rel="nofollow">http://example.com</a> to <a href="https://www.example.com" rel="nofollow">https://www.example.com</a>
  3) Forward from the server IP to the domain </p>
  
  <p>I tried: </p>
  
  <pre><code>RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP_HOST} !^www\. [NC]
  RewriteCond %{HTTP_HOST} !^$
  RewriteCond %{HTTP_HOST} ^111\.11\.111\.111
  RewriteRule ^ https://www.{HTTP_HOST}/%{REQUEST_URI} [L,R=301]
  </code></pre>
  
  <p>But this doesn't work. The IP is the actual server IP. </p>
  
  <p>What am I doing wrong?</p>