[NEED URGENT HELP] All controllers showing 404 except default controller |
I am using these route setting to route through my app. It is working without any error on my localhost but on my online server I can access only the main controller and its methods and the rest of the controllers showing "404 ERROR" page. Please help me to get rid from this issue.
PHP Code: $route['default_controller'] = "home"; My .htaccess code is here Code: RewriteEngine On Thanks in advance.
move: $route['(:any)'] = 'home/$1'; to the end of your list of routes.
"I reject your reality and substitute my own" - Adam Savage, M5 Inc.
(05-16-2015, 03:53 AM)taskone Wrote: Can you access the other controllers when calling their URL directly? Not at all. These are my home controller sections- example.com example.com/faculty-member .... .... My other controllers are Student, Admin, Act- (These are not working) example.com/student example.com/student/profile example.com/admin
As Hobbes mentioned all Any routes need to be the last ones in your routes file because they are a catch all route.
So if you have these routes PHP Code: $route['(:any)'] = 'home/$1'; // http://example.com/any Your student route will never run because the any catch all route will always run. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(05-16-2015, 04:02 AM)Hobbes Wrote: move: $route['(:any)'] = 'home/$1'; to the end of your list of routes. Here it is, but same result- PHP Code: $route['act/load/(:any)'] = 'act/load/$1';
Can you able to access directly?
example.com/index.php/controller/method
Just blind guess - Try to add "RewriteBase /" to your .htaccess file:
Code: RewriteEngine On Or try any of these: .htaccess for CodeIgniter (05-16-2015, 05:25 AM)InsiteFX Wrote: As Hobbes mentioned all Any routes need to be the last ones in your routes file because they are a catch all route. No result, here it is- $route['act/load/(:any)'] = 'act/load/$1'; $route['student'] = 'student'; $route['student/(:num)'] = 'student/profile/$1'; $route['admin'] = 'admin'; $route['admin/(:any)'] = 'admin/$1'; $route['(:any)'] = 'home/$1'; |
Welcome Guest, Not a member yet? Register Sign In |