title: Redirect all to index.php using htaccess
body: <p>I am writing a simple PHP-based MVC-ish framework. I want this framework to be able to be installed in any directory.</p>
  <p>My PHP script grabs the request uri and breaks it off into segments. It makes segment 1 the controller and segment 2 the action. This goes all fine  when I do this:</p>
  <pre><code>http://www.example.com/mvc/module/test/
  </code></pre>
  <p>It will go to the specific module controller and method. Now I have a default controller,  the home controller, which is in folder home.</p>
  <p>Now when I access this folder directly  <code>http://www.example.com/mvc/home/</code>
  It will display a <code>403 forbidden</code> , because this folder does exist, instead it should also go back to  <code>http://www.example.com/mvc/index.php</code></p>
  <p>If I would have installed the framework in a different folder, lets say folder framework it has to redirect back to <code>http://www.example.com/framework/index.php</code></p>
  <p>I would like to redirect every folder and php file back to the index.php, leaving everything else the way it is.</p>
  <p>My first problem I encountered was it never redirects to the right folder, always to the domain root folder.</p>
  <p>This is what I tried :</p>
  <pre><code>RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule . index.php [L]
  </code></pre>