title: Simultaneous redirect from (.html to .php) and (http to https) and (non-www to www) using htaccess
body: <p>I am currently editing an existing site to enable https in it.
  The website has three requirements for redirect</p>
  
  <p>urls with .html to .php<br>
  http to https<br>
  non-www to www</p>
  
  <p>The code I am currently using is this</p>
  
  <pre><code>RewriteEngine on
  RewriteRule ^(.*)\.html$ $1.php [L]
  RewriteCond %{HTTP_HOST} ^websitename\.com$ [NC]
  RewriteRule ^(.*)$ https://www.websitename.com/$1 [L,R=301]
  </code></pre>
  
  <p>But when I check www.websitename.com, it is not being redirected to <a href="https://www.websitename.com" rel="nofollow">https://www.websitename.com</a></p>
  
  <p>I am trying many combinations for days (I have only basic knowledge of regexp), but it is showing one deficiency or another. Any help will be appreciated</p>