title: Force HTTPS in htaccess while also only making public folder accessible
body: <p>This <code>.htaccess</code> file is in my /public_html/ folder:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      RewriteEngine on
      RewriteRule ^$ public/ [L]
      RewriteRule (.*) public/$1 [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>And this <code>.htaccess</code> is inside my /public_html/public/ folder</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I need to add a rule like the following:</p>
  
  <pre><code>RewriteCond %{HTTPS} !=on
  RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
  </code></pre>
  
  <p>I get an issue with it redirecting too many times.</p>
  
  <p>I need to still use the public folder as my root and the front controller inside /public/ but I want to direct all traffic to https.</p>
  
  <p>Can someone help me understand how to go about this?</p>
  
  <p>Do I need to change my rewrite rules pertaining to the /public/ folder? </p>