Run route on uri to get original $page object

Ok, let’s say I have an archive with pages.

Archive with subpage links

If I have not added any routes this snippet works just fine.

<ul>
<?php foreach( site()->pages() as $item)  : ?>
    <li><a href="<?php echo $item->url(); ?>"><?php echo $item->title(); ?></a></li>
<?php endforeach; ?>
</ul>

Don’t work with routes

The above snippet links does not work if the subpages are routed. This is because the $page->url(); return the original url, not the new routed ones.

The routes I use

If you want information about the routes I use, it’s this and similar:

http://getkirby.com/docs/advanced/routing#omitting-the-blog-folder-in-urls

Removed a folder from the url as I’m using folders for panel organisation.