Welcome Guest, Not a member yet? Register   Sign In
HMVC and application folder outside root gives 404 not found
#1

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 ?
Reply
#2

This is what I have that works.
Code:
$config['modules_locations'] = array(
    APPPATH.'components/' => '../components/',
);
Reply
#3

(04-02-2015, 06:28 AM)frocco Wrote: This is what I have that works.
Code:
$config['modules_locations'] = array(
    APPPATH.'components/' => '../components/',
);

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/',)Wink should be it.

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 Smile
Reply
#4

If I move components out of application, this is working for me.
/application
/components
/system
Code:
$config['modules_locations'] = array(
    APPPATH.'../components/' => '../../components/',
);
Reply
#5

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 Smile
That's the one I cannot figure out!
Reply
#6

What does you index.php look like?
Reply
#7

(This post was last modified: 04-02-2015, 07:39 AM by Krycek. Edit Reason: typo )

These 2 values are changed

Code:
/*
*---------------------------------------------------------------
* SYSTEM FOLDER NAME
*---------------------------------------------------------------
*
* This variable must contain the name of your "system" folder.
* Include the path if the folder is not in the same directory
* as this file.
*/
    $system_path = '../system';

/*
*---------------------------------------------------------------
* APPLICATION FOLDER NAME
*---------------------------------------------------------------
*
* If you want this front controller to use a different "application"
* folder than the default one you can set its name here. The folder
* can also be renamed or relocated anywhere on your server. If
* you do, use a full server path. For more info please see the user guide:
* http://codeigniter.com/user_guide/general/managing_apps.html
*
* NO TRAILING SLASH!
*/
    $application_folder = '../application';
Reply
#8

Found it.

It should be

PHP Code:
$config['modules_locations'] = array(
    
APPPATH '../public_html/components/' => '../../public_html/components/',
); 
Reply
#9

Thanks for sharing... Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB