Custom Routes: Disable parent Category



Hi guys,

I’m a new kirby user and it works amazing and everything is so well documented, thanks for creating such a great and simple cms.

Here is the problem I’m having currently … I’d like to kill the parent category in the url to make it more flat and simplify it. Basically I’d like to remove the parent category page.

This is how it usually is:

This is how I’d like it to be:

I tried this snippet for the config file but it doesn’t work…

c::set('routes', array(
   'pattern' => array('(:any)'),
   'action'  => function($uid) {

     $page = page($uid);

     if(!$page) $page = page('projects/' . $uid);
     // if(!$page) $page = site()->errorPage();

     return site()->visit($page);


Any thoughts would be appreciated!



Check out this example:


Amazing! Thanks for pointing to the right direction — works great!