Route broke thumbnails url

Hi all,

Still strugling with routes,

Apparently the route I was looking for a few days ago, is messing with the thumbnails urls and maybe some other stuffs.

The route :

c::set('routes', array(
   array(
      'pattern' => array('shelves/(:all)','sylph-books/(:any)') ,
      'action'  => function($uid) {
         go($uid);
      }
   ),
   array(
      'pattern' => '(:any)(:all)',
      'action'  => function($uid1,$uid2) {
         $page = page($uid1.$uid2);

         if(!$page) $page = page('shelves/' . $uid1.$uid2);
         if(!$page) $page = page('shelves/sylph-books/' . $uid1.$uid2);
         if(!$page) $page = site()->errorPage();

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

Using that route, thumbnail in panel and front returns a broken url.
When I remove the route the thumbs url are good again.

Is the an other way to implement a route similar to that one but without messing with the thumbs links.

Isn’t there a slash missing in the second route? This route can’t possibly work. Also, there is no slash between $page = page($uid1.$uid2);, which does not make sense either?

Thanks for the quick reply.
Adding the missing slash don’t work either… Seems that routing is way above my current skills level.
I’ll try routes again some other time, for now i’ll go with an alternative solution.
In any case, thanks again for your help!

What exactly do you want to do? Maybe we can work it out together?

Oh! well thanks, i’ll try my best.

What i’m trying to achieve is removing part of the url site wise :

Like in this guide, for :

…/content/blog/page/page.txt
into
…/content/page/page.txt

But also for url structures like this :

…/content/blog/subdir/page/page.txt

This is something discussed in this post : Omitting parts of URLs, the route here comes from one of the replies, seems it wasn’t the proper way :confused:.
And also here, (sorry for the duplicate now) : Help using routes on subpage