Welcome Guest, Not a member yet? Register   Sign In
[RESOLVED] 'default_controller' vs 'controller in sub-directory'
(This post was last modified: 01-20-2016, 04:52 AM by cloud_live. Edit Reason: Problem is resolved. )

Hi All,

I have some question to ask.

I have a controller inside a sub-directory. To be more specific. I have a controller name 'Main' (Main.php) in sub-directory 'Report' so the path to this controller will be 'controllers/Report/Main.php'.

I can access to the controller by typing the url like 'mywebsite.com/Report/Main'. The page displays correctly.
Now I want to config the 'default_controller' to point to this controller when visitor type 'mywebsite.com' or 'mywebsite.com/index.php'.

I opened 'config/routes.php' and changed $route['default_controller'] to 'Report/Main/'. I saved and closed.

I tried 'mywebsite.com/index.php'. The webpage show me '404' error. I tried to enter the url manually. The target page is displayed correctly.

I thought the controller named 'Main' might be reserved word. So I changed 'Report/Main.php' to 'Report/MainPage.php' and I also changed the controller name inside the file. Then I changed $route['default_controller'] to 'Report/MainPage/'. Still '404' error.

Any advice would be appreciated.

Thank you so much in advance.

Have a nice day everyone Smile

With Best Regards,

Messages In This Thread
[RESOLVED] 'default_controller' vs 'controller in sub-directory' - by cloud_live - 01-20-2016, 03:04 AM

Theme © iAndrew 2016 - Forum software by © MyBB