title: .htaccess : http to https redirection does not work
body: <p>I have a problem with my .htaccess and https redirection.</p>
  
  <p>First of all, I have consulted these links to find a solution but none could help me.</p>
  
  <p>List of links :</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/13376219/htaccess-redirect-http-to-https">.htaccess redirect http to https</a></li>
  <li><a href="https://stackoverflow.com/questions/3659732/modrewrite-with-https">ModRewrite with HTTPS</a></li>
  <li><a href="https://www.ndchost.com/wiki/apache/redirect-http-to-https" rel="nofollow noreferrer">https://www.ndchost.com/wiki/apache/redirect-http-to-https</a></li>
  <li><a href="https://stackoverflow.com/questions/13977851/htaccess-redirect-to-https-www">htaccess redirect to https://www</a></li>
  <li><a href="https://serverfault.com/questions/116206/how-do-i-use-htaccess-to-always-redirect-from-http-to-https">https://serverfault.com/questions/116206/how-do-i-use-htaccess-to-always-redirect-from-http-to-https</a></li>
  </ul>
  
  <p>When I load the page with http, the .htaccess redirect me to https but when I load the page with https, I have an infinite loop.</p>
  
  <p>Here is my .htaccess code :</p>
  
  <pre><code>RewriteEngine on
  
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  
  RewriteCond %{HTTP_HOST} ^(api|www|dev|stefano|sav)\.
  RewriteCond %{REQUEST_URI} !^/(api|www|dev|stefano|sav)/
  RewriteCond %{DOCUMENT_ROOT}/%1 -d
  RewriteRule ^(.*)$ %1/$1 [L]
  </code></pre>
  
  <p>Is anybody can help me create a redirect condition (http to https) ?</p>