Uhm I might be braindead but how in do i omitt every first level page… (I don´t know the name, the user will name it)
c::set('routes', array(
array(
'pattern' => '(:any)/(:all)',
'action' => function($u1, $u2) {
go($u2);
}
),
array(
'pattern' => '(:any)',
'action' => function($uid) {
$page = page($uid);
if(!$page) $page = page('the first page/'. $uid);
if(!$page) $page = site()->errorPage();
return site()->visit($page);
}
)
));