Codeigniter Dynamic Routing
Hi i wont to make something like that. http:// example.com/ - Main Controller http:// example.com/rules/ - Main Controller where content get from database, but if not exist return 404 page. (It's ok, isn't problem.) But if i have subfolder in application/controlles/rules/ I want to redirect it to Main Contorller at Rules folder. This follow code can solve problem, but i don't know how it right realise. At routes.php: $route['default_controller'] = "main"; $route['404_override'] = ''; $dirtest = $route['(:any)']; if (is_dir(APPPATH.'controllers/'.$dirtest)) { $route['(:any)'] = $dirtest.'/$1';