codeigniter - Code Igniter doesn't recognize my function in controller under a folder -


i have folder under main controller-folder called admin, in controller have file name admin.php has function xyz.

i want access function using url

http://localhost/webroot/admin/xyz

however when try access it, giving me error.

404 page not found  page requested not found. 

this code of routes.php file

$default_controller = "welcome"; $controller_exceptions = array('welcome','forum'); $route['default_controller'] = $default_controller; $route["^((?!\b".implode('\b|\b', $controller_exceptions)."\b).*)$"] = $default_controller.'/$1'; $route['404_override'] = ''; $route['admin'] = "admin/admin"; 

this .htaccess file

 rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule .* index.php/$0 [pt,l]   

also mod-rewrite enabled :)

please let me know why not working , how can make work. kind of appreciated. thanks

ensure routes stored in application/config/routes.php (not router.php specified in question). try adding route uses wildcard, this:

$route['admin']        = "admin/admin";    //routes 'index()' function $route['admin/(:any)'] = "admin/admin/$1"; //handles other cases 

:any match segment containing character(s), after admin segment, , pass it/remmap the admin controller.

the user guide contains more information on controllers in sub-folders , routing.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -