Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeIgniter default controller in a sub directory not working
    text
    copied!<p>My default_controller in the routes configuration is set as "home.php".</p> <p>I have a sub directory for my controllers, lets call it "folder". So if I visit <a href="http://mysite.com/folder/" rel="noreferrer">http://mysite.com/folder/</a>, the default controller "folder/home.php" should be called right?</p> <p>However for some reason this doesn't work, I get a 404. Visiting <a href="http://mysite.com/folder/home" rel="noreferrer">http://mysite.com/folder/home</a> or <a href="http://mysite.com/folder/home/index" rel="noreferrer">http://mysite.com/folder/home/index</a> works as expected. In addition to this, the default controller works in the root directory (<a href="http://mysite.com" rel="noreferrer">http://mysite.com</a> loads home.php).</p> <p>Any ideas, has anyone else experienced this? I can't get my head around it - it would appear to be a CI issue but I can't find anybody else having the same problem.</p> <p>The documentation, from the way I understand it at least, suggests that this should work fine: <a href="http://codeigniter.com/user_guide/general/controllers.html#subfolders" rel="noreferrer">http://codeigniter.com/user_guide/general/controllers.html#subfolders</a></p> <p>Setting the default controller to "folder/home.php" means that <a href="http://mysite.com/folder/" rel="noreferrer">http://mysite.com/folder/</a> works fine as expected. Except for I want the default controller to just be "home.php" - whether in the root or in a sub directory, home.php within that directory should be loaded, as the documentation suggests.</p> <p>Cheers</p>
 

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