![]() |
HMVC and application folder outside root gives 404 not found - 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: HMVC and application folder outside root gives 404 not found (/showthread.php?tid=1695) |
HMVC and application folder outside root gives 404 not found - Krycek - 04-02-2015 Hello, I have CI3 with the following structure application public_html system Now I have HMVC for CodeIgniter 3 with the following structure application public_html /components /components/photalbums/config /components/photalbums/config/routes.php /components/photalbums/controllers /components/photalbums/controllers/com_photoalbum.php /components/photalbums/models /components/photalbums/views system Now I have in the components/photalbums/config/routes.php $route['test'] = 'com_photoalbum'; When going to localhost/test I get an 404 Probably $config['modules_locations'] = array(APPPATH . '../components/' => '../../components/',); in config is not set correct. I tried alot with Document Root etc --- In version CI2 with HMVC for CI2 I have the application directory in the public_html. Then with $config['modules_locations'] = array(APPPATH . '../components/' => '../../components/',); it is working Version 2 structure is public_html application /components /components/photalbums/config /components/photalbums/config/routes.php /components/photalbums/controllers /components/photalbums/controllers/com_photoalbum.php /components/photalbums/models /components/photalbums/views system Anyone an idea ? RE: HMVC and application folder outside root gives 404 not found - frocco - 04-02-2015 This is what I have that works. Code: $config['modules_locations'] = array( RE: HMVC and application folder outside root gives 404 not found - Krycek - 04-02-2015 (04-02-2015, 06:28 AM)frocco Wrote: This is what I have that works. Yeah thats the default (where you have components in the application folder). In version 2 I had the components directory in the root (next to system and application) /application /components /system Then this ($config['modules_locations'] = array(APPPATH . '../components/' => '../../components/',) ![]() However now I have the application directory OUTSIDE the public and the components directory INSIDE the public. Then $config['modules_locations'] = array(APPPATH . '../components/' => '../../components/',); aint working ![]() RE: HMVC and application folder outside root gives 404 not found - frocco - 04-02-2015 If I move components out of application, this is working for me. /application /components /system Code: $config['modules_locations'] = array( RE: HMVC and application folder outside root gives 404 not found - Krycek - 04-02-2015 Yup thats correct (see my post) Quote Me : Then this ($config['modules_locations'] = array(APPPATH . '../components/' => '../../components/',)Wink should be it. But now try with application and system outside public root AND components INSIDE public root ![]() That's the one I cannot figure out! RE: HMVC and application folder outside root gives 404 not found - frocco - 04-02-2015 What does you index.php look like? RE: HMVC and application folder outside root gives 404 not found - Krycek - 04-02-2015 These 2 values are changed Code: /* RE: HMVC and application folder outside root gives 404 not found - Krycek - 04-03-2015 Found it. It should be PHP Code: $config['modules_locations'] = array( RE: HMVC and application folder outside root gives 404 not found - frocco - 04-03-2015 Thanks for sharing... ![]() |