I managed to run default controller from sub directory by adding a MY_Router file in application/core, everything works fine but this is what I am facing now.I am unable to route it if url hits /admin or /student or /teacher which is eventually a sub directory in controllers.
https://s14.postimg.org/pr3ta38f5/controller_structure.png
https://s14.postimg.org/z05zk7hb5/error_1.png
https://s14.postimg.org/mmt5darmp/issue_2.png
https://s14.postimg.org/kwa4bta3l/page_controller.png
https://s14.postimg.org/j5voo2hy9/routes.png
If you folder structure is thus:
- controllers
- teachers
- Teacher_home.php
- students
- Student_home.php
- admin
- Admin_home.php
Then normal CI routing would be with URLs to the default index method would be like:
mysite/teachers/teacher_home
mysite/students/student_home
mysite/admin/admin_home
Your routes could then point mysite/teacher_home to the relevant controller above like this:
$route['teacher_home'] = 'teachers/teacher_home';
In the CI docs they describe the wild cards you can use: http://www.codeigniter.com/user_guide/general/routing.html
But any route must point to a valid controller/method url. Get your site/app working under normal default routing, then add the alternate routing in afterwards.
So remove your current routes. If you have a default route in it will probably be messing up your other routes if you have not written it properly, or in the right order.
Hope that helps,