Hi,
After reading your article i copied the router code to routes.php.
Actual url is
http://lv.lamparch.com/index/category/Allahabad/Real-Estate-Property-Flat-Mates-Room-Mates/c123
where controller is : index and action is: category
but whenever i try the url below is get an error .
http://lv.lamparch.com/Allahabad/Real-Estate-Property-Flat-Mates-Room-Mates/c123
Very nice solution! But it doesn't account for plugins. Since it's only about the first argument I think it would suffice to replace this:
$controllers = Configure::listObjects('controller');
with this:
$controllers = am(Configure::listObjects('controller'), Configure::listObjects('plugin'));
Also, your regex seems to match index actions without a trailing slash on existing controllers, say yourwebsite.com/somecontroller, as opposed to yourwebsite.com/comecontroller/ which does route to the correct controller (using cake 1.2.5). I'm still looking into that though..
Update (sorry for the double post): I think you force the last slash with your regex. I now use this alternative which also includes end of line as part of the negative lookahead:
(?!('.$controllers.')((\W+)|$))[a-zA-Z\-_]+/?$
Seems to work nicely thusfar :).