简体   繁体   中英

Default controller (under modules) not loading under HMVC, CodeIgniter, throws 404 err

Just migrated my CI from localhost to live. Everything works fine on localhost with same settings.

Here're the folder/file structure and contents of routes.php

-application
--controllers
---Home.php
--modules
---specs
----controllers
-----Specs.php
----models
----views

$route['default_controller'] = 'Specs/index';
//$route['default_controller'] = 'Home/index';
$route['404_override'] = 'Errors/show_404';
$route['translate_uri_dashes'] = FALSE;

Both Specs and Home controllers have index method. When I load the home page url with Specs/index as default controller, I get 404 error. But if I change the default controller to Home/index, it loads just fine. Strange. Everything else works just fine on whole site. Can't figure out.

The website is live but I'm not sure if providing url is allowed, so I'm including spaces in it. It's unspecs dott comm. Admin/Mods may please remove if url isn't allowed.

Thanks for reading.

Try this https://stackoverflow.com/questions/6529026/codeigniter.. . But better use standart folder for default controller /application/controllers

I think you are doing mistake in routing, for HMVC it should be like that -

$route['default_controller'] = '<folder name>/<controller name>/<function name>';

$route['default_controller'] = 'specs/Specs/index';

Please follow this, hope it will work fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM