# Routing: Omitting everything but uid

**URL:** <https://forum.getkirby.com/t/routing-omitting-everything-but-uid/3142>\
**Category:** Questions\
**Tags:** v2\
**Created:** [January 27, 2016, 12:39pm UTC](https://forum.getkirby.com/t/routing-omitting-everything-but-uid/3142 "2016-01-27T12:39:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![blows](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/blows/32/5241_2.png) [@blows](https://forum.getkirby.com/u/blows)\
**Post date:** [June 15, 2017, 11:05pm UTC](https://forum.getkirby.com/t/routing-omitting-everything-but-uid/3142/3 "2017-06-15T23:05:37Z")

</div>

I’m trying to implement a similar feature, but not throughout the whole site, only on a specific folder.

The folder structure is:

Magazine

- 
  - issue-1

- 
  - issue-2

- 
  - …etc

- 
  - issue-18

- 
  - 
    - article

And I want all article urls to be ‘[domain.com/article](http://domain.com/article)’ instead of ‘[domain.com/magazine/issue-n/article](http://domain.com/magazine/issue-n/article)’.

Have been reading about routes and lots of helpful [posts](https://forum.getkirby.com/t/omit-a-variable-letter-or-number-in-route/5099) on [here](https://forum.getkirby.com/t/omitting-parts-of-urls/539), but am missing something, as I have got everything directing to ‘[domain.com/article](http://domain.com/article)’ but it’s showing the error page.

Here’s my latest attempt, any pointers would be much appreciated!

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

      $page = page($uid);

      if(!$page) $page = page('magazine/issue-' . str::substr($uid, 5) . '/' . $uid);
      if(!$page) $page = site()->errorPage();

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

    }
  ),
  array(
     'pattern' => 'magazine/(:any)/(:any)',
     'action' => function($issue, $article) {
       return go($article);
     }
  )
));

```

Edit: The page ‘[domain.com/magazine](http://domain.com/magazine)’ must still work, and would it be possible to have ‘[domain.com/magazine/issue-n](http://domain.com/magazine/issue-n)’ also still work?

---

_[View the full topic](https://forum.getkirby.com/t/routing-omitting-everything-but-uid/3142)._
