title: Redirecting to https on .htaccess with single page application
body: <p>htaccess for a Single page application, and I want to add https redirect.</p>
  <pre><code>&lt;ifModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule (.*) index.php [QSA,L]
  &lt;/ifModule&gt;
  </code></pre>
  <p>I tried to apply it but web server redirect indefinitely</p>
  <pre><code>&lt;ifModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule (.*) index.php [QSA,L]
  
      RewriteCond %{HTTPS} off
      RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]
  &lt;/ifModule&gt;
  </code></pre>