Q:

Redirecting almost all urls that contain a number to one function - Kohana3 framework

I have an action within the controller in Kohana3 framework, everything works fine.
When I type in the url myconroller/myaction/5 in the browser, it goes to the proper action_myaction(), and param 5 can be accessed as $this->request->param('id);
My question is: how to catch all URLs that looks like
myconroller/myaction-XXX/5  (XXX is any number from 1 to 999)
to go to action_myaction()?
If I had only several URLs of such type, I would create several actions that call a function by passing XXX as a parameter. 
But what if I have up to 999 possible valid URLs?
Should I modify a bootstrap.php in a proper way? How?
Or, there is another option (if exists)?

A:

Here is the answer for my question.  Add the rules for routes in the bootstrap.php before the default route:
Route::set('xxxroute', 'myconroller/myaction-<param1>/<id>'
array(
    'param1' =>'\d+',
    'id' =>'\d+'
))
->defaults(array(
    'controller' =>'myconroller',
    'action' =>'myaction',
));

This way param1 is a number (else it goes to the default route) and it goes straight to  the action myaction.
The parametres could be found there by:
$id=$this->request->param('id');
$param1=$this->request->param('param1');

Hope this helps to someone else.

