Route not working

I am trying to redirect access to a top level page to a subpage, but it doesnt seem to work.

This should be possible right?

    'pattern' => array('/toplevelpageone/'),
    'action'  => function() {
      // do something here when the URL matches the pattern above
      return go('/toplevelpageone/subpage');
c::set('routes', [
       'pattern' => 'somepage',
       'action'  => function() {

return go() doesn’t really make sense; also, I don’t know why you are using the slashes…

Thanks that did it. I used return go() because it was in the docs, under redirecting.

Then the problem was rather related to the slashes, not the return go.

Happy anniversary :slightly_smiling_face:

Thanks! It’s not my forum anniversary, it is in fact my Birthday. :cake:

Oh, then Happy Birthday, of course. Shouldn’t you be celebrating instead of wasting your time on the forum? :cake::tada::tada::tada::tada::tada::tada::tada:

It’s never a waste of time on the forum :slight_smile: Besides, I’m going out for dinner in a minute. :pizza: