CodeIgniter Forums
Help for routing - 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: Help for routing (/showthread.php?tid=61773)



Help for routing - webdevron - 05-15-2015

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 method showing "404 ERROR" page. Please help me to get rid from this issue.


PHP Code:
$route['default_controller'] = "home";

$route['(:any)'] = 'home/$1'   // http://example.com/any
$route['load/(:any)'] = 'home/load/$1' // http://example.com/load/any

$route['student'] = 'student' // http://example.com/student
$route['student/(:num)'] = 'student/profile/$1' // http://example.com/student/1234

$route['admin'] = 'admin' // http://example.com/admin
$route['admin/(:any)'] = 'admin/$1' // http://example.com/admin/any 

Thanks in advance.


RE: Help for routing - taskone - 05-15-2015

Can I see the contents of the .htaccess file in your root please?


RE: Help for routing - webdevron - 05-15-2015

(05-15-2015, 03:27 PM)taskone Wrote: Can I see the contents of the .htaccess file in your root please?

Sure, here it is-


Code:
RewriteEngine On

RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]