![]() |
Routing question - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Routing question (/showthread.php?tid=71485) |
Routing question - TamasD - 08-19-2018 Hi. I have created a sub-directory under application/controllers/ called "Admin". In there I created a controller called "Admin.php" Similarly in views I created a subdirectory called "admin" In routes I added this line: PHP Code: $route['admin'] = "admin/admin"; Now I can access my admin folder by going to mysite.com/admin/ Then I created a new controller called "Controllers/Admin/Settings.php" and a view file called "admin/settings.php" I'd like to access it by going to mysite.com/admin/settings but I get a 404 error. I tried every variation in route I could think of, but I can't figure it out. Thanks for any help. RE: Routing question - jreklund - 08-19-2018 Do you have more rewrite rules? Because that's the only thing you need under CI 3.1.9. Are your functions named index() inside your Settings.php/Admin.php? RE: Routing question - TamasD - 08-19-2018 Oh, thanks. I didn't name the function "index". |