title: Codeigniter Routes Controller Sub Folder
body: <p>I've a problem with routes and controller. I've got 2 types of controller: first type is used to manage the webpages, second type is used for cms and I prefer to put them in a sub-folder. Example:</p>
  
  <pre><code>/controller/site.php (for webpages)
  /controller/admin/ (for controllers to manage cms)
  </code></pre>
  
  <p>in routes.php I've write:</p>
  
  <pre><code>$route['(:any)'] = "site/$1";
  $route['admin/(:any)'] = "admin/$1";
  </code></pre>
  
  <p>I've got the file .htacces set in this way:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond $1 !^(index\.php|images|robots\.txt|css|js|font|woff|ttf|svg|eot|favicon\.ico)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
  </code></pre>
  
  <p>and this variable on config.php:</p>
  
  <pre><code>$config['index'] = '';
  </code></pre>
  
  <p>but it works only for "site". If I write "mywebsite/admin/login" for example, it return 404 error.</p>
  
  <p>I've found also MY_Router to extend CI_Route but doesn't work.</p>
  
  <p>Can someone help me to resolve this problem ?</p>