Well i need to make it so any user can have a foo.com/username in my site where i user a Zend framework.
The thing is that i want foo.com/login and other controllers to keep working as they do, so i already validate that no user can be named as one of the controllers im going to use. The htaccess cant be changed or the mvc configuration wont work. So im using the Router.
I know that if i use something like:
$routes = array();
$routes['entry'] = new Zend_Controller_Router_Route_Regex('SOME REGEX HERE',
array(
'controller' => 'profile',
'action' => 'show'
),
array(
'id' => "dsadsa", // maps first subpattern "(\d+)" to "id" parameter
1 => 'id' // maps first subpattern "(\d+)" to "id" parameter
)
);
$router->addRoutes($routes);
i can make it so everything that matches the regex is redirected, but i dont know if theres a better way(somehow chaining 2 routers) where i dont have to actually list my controllers in a very very big OR.
Any idea?