
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
With Best Regards,
Chatawat
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

With Best Regards,
Chatawat