0

I have these codes in routes.php

$route['default_controller'] = 'home'; 

$route['controller1/(:any)'] = 'folder1/index/$1'; // working

$route['folder2/'] = 'folder2/home/index/'; //doesn't working
$route['folder2/(:any)'] = 'folder2/home/index/$1'; //doesn't working

$route['(:any)'] = 'home/index/$1';

My default controller is home. Now any characters to my home page like this: => (localhost/mywebsite/(any category name) => http://localhost/mywebsite/cars taking me to the home page controller => index function. If that any characters equals to any controllers without folder, website redirecting me to that controller. But general problem is this, if that any character equals to any folder site doesn't redirecting me to that folder or controller inside that folder. See above code comments my folder route doesn't work. How can I do this?

NurlanXp
  • 156
  • 2
  • 14
  • Possible duplicate of [routing controllers in sub folders - codeigniter](https://stackoverflow.com/questions/13955335/routing-controllers-in-sub-folders-codeigniter) – Vickel Dec 24 '17 at 15:53
  • I tried these before not worked. – NurlanXp Dec 24 '17 at 17:21

0 Answers0