URL shows error 404 instead of default controller - 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: URL shows error 404 instead of default controller (/showthread.php?tid=64913) |
URL shows error 404 instead of default controller - Parker1090 - 04-10-2016 Hi, I'm looking for a bit of guidance with this one, as it's proving to be a bit tricky! My set up is as follows:
PHP Code: $route['404_override'] = ''; However, visiting just 'another.example.com' shows a 404 rather than /another/login Hopefully I've given more than enough info, but knowing me I've missed something simple! Any help appreciated! RE: URL shows error 404 instead of default controller - PaulD - 04-10-2016 Hi, Not sure if this is the cause of your problem, but your controllers directory can only have files or one sub level of folders. So a controller called login can be in controllers/login.php or controllers/members/login.php but not controllers/another/members/login.php as CI will assume 'members' is the class name in that case. I hope that makes sense and might be of some help, Best wishes, Paul. RE: URL shows error 404 instead of default controller - Parker1090 - 04-11-2016 Hi Paul, Thanks for your reply! Login.php (the controller) is stored at /controllers/example/Login.php. However, on that note, I do have other folders in /example/ and they seem to load fine. I'm guessing that's not intended judging by your post, but it seems to work. I weren't aware that it was limited to one level of sub-folders for controllers so I just done what I thought would be best organisation wise. But thank you for your suggestion |