Search code examples
phpcodeignitercodeigniter-routing

how do I access controller that is in sub directory of "application/controllers" when $config['enable_query_strings'] = TRUE


my codeigniter application config:

$config['enable_query_strings'] = TRUE;
$config['uri_protocol'] = 'PATH_INFO';

so I can access my application like this : index.php?c=index&m=about

but I have a controller in "application/controllers/setting/" directory , named user.php

if mod_rewrite is enabled , i can access like : index.php/setting/user/someMethod

but How do I access it like this : index.php?c=setting/user&m=someMethod the result is 404 Not Found

log file says:

ERROR - 2011-08-11 08:03:07 --> 404 Page Not Found --> settinguser

EDIT

Answer:

index.php?d=setting&c=user&m=someMethod


Solution

  • You can access them like this

    index.php?d=setting&c=user&m=someMethod
    

    You need the directory trigger if you have a sub directory. It's in your config.php file but it has the experimental comment.

    $config['allow_get_array'] = TRUE;
    $config['enable_query_strings'] = TRUE;
    $config['controller_trigger'] = 'c';
    $config['function_trigger'] = 'm';
    $config['directory_trigger'] = 'd'; // experimental not currently in use