Take the 2-minute tour ×

We are currently using Kohana 3 for a staging application which is getting ready for production. We have few requirements to set custom routing and custom error codes. Most of the solutions offered in Kohana 3 suggests modifying bootstrap.php directly. Is that a best practice to do? In Kohana 2.x, they had something like routes.php as part of configuration. I believe that is replaced by regular expression routing in Kohana 3 which is placed inside bootstrap.php along with other out-of-box settings.

Please suggest the best practice followed by Kohana 3 community. I don't mind changing bootstrap.php but wondering if there is any configuration files specifically for routing.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

There is no single best practice. But if you have many routes (and usually you have), I suggest you to create a new file routes.php in application folder and include it in bootstrap.php.

So instead of Route::set('default'... in your bootstrap.php you will have require_once APPPATH.'routes.php';

share|improve this answer
thanks for the suggestion. waiting for other answers, if any, before accepting this. –  Murukesh Aug 4 '11 at 9:02

Your Answer


