Note that there are some explanatory texts on larger screens.

plurals
  1. PORedirect all to index.php htaccess
    primarykey
    data
    text
    <p>My apologies for the 10000000th question on this topic, but i just can't get it to work the way i want it.</p> <p>I'm writing a simple php mvc'ish framework. I want this framework to be able to be installed in any directory.</p> <p>What my php script does : Grabs the request uri and breaks it off into segments. Making segment 1 the controller and segment 2 the action. This goes all fine when i do this:</p> <p><a href="http://www.domain.com/mvc/module/test/">http://www.domain.com/mvc/module/test/</a></p> <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 acces this folder directly <a href="http://www.domain.com/mvc/home/">http://www.domain.com/mvc/home/</a> It will display a 403 forbidden, because this folder does exist, instead it should also go back to <a href="http://www.domain.com/mvc/index.php">http://www.domain.com/mvc/index.php</a></p> <p>If i would have installed the framework in a different folder, lets say folder framework it has to redirect back to <a href="http://www.domain.com/framework/index.php">http://www.domain.com/framework/index.php</a></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> <p>I really hope someone could help me out or point me into the right direction!</p> <p>Thanks alot!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload