I have my CakePHP router set up like this-
Router::connect('/*', array('controller' => 'posts', 'action' => 'p'));
This results in the dynamic url www.example.com/x22bh1 being routed to www.example.com/posts/p/x22bh1.
However my other urls that like www.example.com/aboutus or www.example.com/register etcetera are also routed to www.example.com/posts/p/* which is an unexpected behavior. Now to fix this I can define a regex based router. But for that to work, I'll need to specify all the exception pages that I don't want to get routed. So is there a way for both the features to work without specifying all the exception pages one by one in the router? Like if there is a controller and action for the URL then don't route but if there isn't then go to the default controller/action?
www.example.com/x22bh1 => Controller x22bh1
not found so route to www.example.com/posts/p/x22bh1.
www.example.com/register => Controller register
with action index
found so go to default page www.example.com/register/index