title: Redirect non-www and www http requests to https://www
body: <p>I need to redirect all non-www request and http request on my website to <a href="https://www.example.com" rel="nofollow">https://www.example.com</a>.
  I use an Apache server but I can't find anything useful to help me do that. 
  Currently I use the .htaccess file to redirect non-www request to www.</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{HTTP_HOST} !^www\.
  RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
  </code></pre>