# Route not working

**URL:** <https://forum.getkirby.com/t/route-not-working/10189>\
**Category:** Questions\
**Tags:** v2\
**Created:** [April 10, 2018, 2:43pm UTC](https://forum.getkirby.com/t/route-not-working/10189 "2018-04-10T14:43:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [April 10, 2018, 2:43pm UTC](https://forum.getkirby.com/t/route-not-working/10189/1 "2018-04-10T14:43:45Z")

</div>

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?

```auto
  array(
    'pattern' => array('/toplevelpageone/'),
    'action' => function() {
      // do something here when the URL matches the pattern above
      return go('/toplevelpageone/subpage');
    }
  )

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 10, 2018, 3:37pm UTC](https://forum.getkirby.com/t/route-not-working/10189/2 "2018-04-10T15:37:49Z")

</div>

```auto
c::set('routes', [
  [
       'pattern' => 'somepage',
       'action' => function() {
          go('somepage/subpage');
       }
  ]
]);

```

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

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [April 10, 2018, 3:45pm UTC](https://forum.getkirby.com/t/route-not-working/10189/3 "2018-04-10T15:45:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 10, 2018, 3:48pm UTC](https://forum.getkirby.com/t/route-not-working/10189/4 "2018-04-10T15:48:04Z")

</div>

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

Happy anniversary 🙂

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [April 10, 2018, 4:13pm UTC](https://forum.getkirby.com/t/route-not-working/10189/5 "2018-04-10T16:13:25Z")

</div>

> [@texnixe](#):
>
> Happy anniversary 🙂

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

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 10, 2018, 4:21pm UTC](https://forum.getkirby.com/t/route-not-working/10189/6 "2018-04-10T16:21:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [April 10, 2018, 4:28pm UTC](https://forum.getkirby.com/t/route-not-working/10189/7 "2018-04-10T16:28:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:28pm UTC](https://forum.getkirby.com/t/route-not-working/10189/8 "2025-02-06T17:28:25Z")

</div>

Archived on February 6, 2025, 5:28pm UTC


