[eluser]n0xie[/eluser]
Or just extend the Router class and you have your database driven routes.
The problem with writing a routing file is that CI uses a 'first match, first serve' logic, which could give you unsuspected behaviour. I say unsuspected, because it will not be a bug: the CI routing class will do exactly as you tell it, but it might not do it in the order you want it to. Unless you keep track of what routing rule should fire first, this can get real messy, and
very hard to debug.
A basic example:
Code:
$route['product/:any'] = "catalog/product_overview";
$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";
vs
Code:
$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";
$route['product/:any'] = "catalog/product_overview";
Even though this example is crude and very simple, you can see that the order in which you will write your rules to a file is very important. So if you do decide to go this way, you need to have a system which checks for these sort of things.