Welcome Guest, Not a member yet? Register   Sign In
Controllers in sub-folders don't seem to work

edit: Nevermind, i forgot to add in index.php. i'm an idiot. :p


I'm trying to organize all my controllers into sub-folders. As per the documentation, the first section of the url must be the folder name followed by the controller name like so


I have done this but i'm still getting a 404 not found page.

Currently, this project sits within: localhost/project which I assume would cause the above method to break since the first segment is "project", in this case. But I modified my DocumentRoot in my hosts file so that "localhost" alone points to: localhost/project. Still getting the 404 error though.

Any one know why?


You need to setup routes for them.
$route['subfolder/controller/(:any)'] = 'subfolder/controller/$1';

CodeIgniter User Guide - URI Routing

Theme © iAndrew 2016 - Forum software by © MyBB