title: Could someone explain these Apache rewrite rules?
body: <p>I am taking an online course in which the instructor implements a couple of Apache rewrite rules - something that I have not come across before, and which the instructor fails to explain in any detail.</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteRule ^$ public/ [L]
      RewriteRule (.*) public/$1 [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I understand that the rules are there to rewrite the URL, making it seem like <code>public/</code> is not part of it. However, I am after a more detailed explanation.</p>
  
  <p>My question is essentially: Could someone explain how these rewrite rules turn something like <code>application/public/index</code> into just <code>application/index</code>?</p>