I am using Codeigniter with the HMVC Modular extension and have a backend CMS area for managing website content. I am routing the base URL + "admin" (http://localhost/cms/admin) to controller methods with the prefix "admin_".
e.g. function admin_index() {...}
And here is my routing:
$route['admin/([a-zA-Z]+)/(:any)'] = "$1/admin_$2"; $route['^admin/(:any)(/)?'] = "$1/admin_index"; $route['^admin(/)?'] = "dashboard/admin_index"; $route['admin/logout'] = "login/admin_logout";
With the HMVC it is not routing correctly now. Here is what happens:
URL: http://localhost/cms/admin/faqs Directory: modules/faqs/controllers/faqs - index method -- here is where it breaks -- URL: http://localhost/cms/admin/faqs/categories Directory: modules/faqs/controllers/faqs - categories method (does not exits) Desired: modules/faqs/controllers/categories - index method
How can I use HMVC while maintaining the "admin" are of the website?