title: How to redirect root index URLs to sub directory using htaccess
body: <p>I need to redirect index of script root directory to a sub directory in it. I want to get it to work in all conditions below:</p>
  
  <pre><code>http://www.domain.com =&gt; http://www.domain.com/public
  http://www.domain.com/dir =&gt; http://www.domain.com/dir/public
  http://www.domain.com/dir1/dir2 =&gt; http://www.domain.com/dir1/dir2/public
  </code></pre>