# Router problem with Pattern at end of URL

**URL:** <https://forum.getkirby.com/t/router-problem-with-pattern-at-end-of-url/8277>\
**Category:** Questions\
**Tags:** v2\
**Created:** [August 17, 2017, 2:12pm UTC](https://forum.getkirby.com/t/router-problem-with-pattern-at-end-of-url/8277 "2017-08-17T14:12:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Svnt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/svnt/32/620_2.png) [@Svnt](https://forum.getkirby.com/u/Svnt)\
**Post date:** [August 17, 2017, 2:12pm UTC](https://forum.getkirby.com/t/router-problem-with-pattern-at-end-of-url/8277/1 "2017-08-17T14:12:27Z")

</div>

Hi,

Goole is indexing wrong sites on our blog. Maybe still in googles cache? I don’t know, anyway.

I tried to redirect the wrong URL with no success yet.

Here is a wrong Url: `https://mydomain.de/schutz-gegen-ransomware-locky-und-co/blog/category:Sicherheit`

This part is wrong: `/blog/category:Sicherheit` and should be removed but the router want work.

Here is my router:

```
/*-------------------------------------
Setup Kirby Routes
-------------------------------------*/
c::set('routes', array(
  array(
    'pattern' => '(:any)',
    'action' => function($uid) {
      $page = page($uid);
      if(!$page) $page = page('blog/' . $uid);
      if(!$page) $page = site()->errorPage();
      return site()->visit($page);
    }, 'method' => 'GET|POST'
  ),
  array(
    pattern' => '(:all)/blog/category:(:all)',
   'action' => function($uid) {
      return site()->visit($uid);
   }
  ), 
  array(
    'pattern' => 'blog/(:any)',
    'action' => function($uid) {
      go($uid, 301);
    },'method' => 'GET|POST'
  ),
  array(
    'pattern' => '(:any)/feed',
    'action' => function($uid) {
      go('feed');
    }, 'method' => 'GET|POST'
  ),
  array(
    'pattern' => 'page/(:num)',
    'action' => function($num) {
      go('page:'.$num);
    }
  )
));

```

Any idea what’s wrong here?

Svnt

---

<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:** [August 17, 2017, 2:15pm UTC](https://forum.getkirby.com/t/router-problem-with-pattern-at-end-of-url/8277/2 "2017-08-17T14:15:43Z")

</div>

I think, you can’t use parameters in routes.

---

<div class="post-metadata">

**Author:** ![Svnt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/svnt/32/620_2.png) [@Svnt](https://forum.getkirby.com/u/Svnt)\
**Post date:** [August 17, 2017, 2:23pm UTC](https://forum.getkirby.com/t/router-problem-with-pattern-at-end-of-url/8277/3 "2017-08-17T14:23:42Z")

</div>

Sad.  
So there is no way to cut away the “/blog/cat…” part?

---

<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:** [August 17, 2017, 2:27pm UTC](https://forum.getkirby.com/t/router-problem-with-pattern-at-end-of-url/8277/4 "2017-08-17T14:27:23Z")

</div>

Maybe you can do it in your .htaccess or server configuration?

You can also get Google to remove the URL from their search engines.

---

<div class="post-metadata">

**Author:** ![Svnt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/svnt/32/620_2.png) [@Svnt](https://forum.getkirby.com/u/Svnt)\
**Post date:** [August 17, 2017, 2:33pm UTC](https://forum.getkirby.com/t/router-problem-with-pattern-at-end-of-url/8277/5 "2017-08-17T14:33:47Z")

</div>

If this are the only two option i’ll try it.

Thank you!

---

<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:** [August 17, 2017, 2:41pm UTC](https://forum.getkirby.com/t/router-problem-with-pattern-at-end-of-url/8277/6 "2017-08-17T14:41:50Z")

</div>

Well, actually, if it is just for simple rewrites like this, where no Kirby code is needed, those two options are preferable to using routes, anyway.

---

<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:23pm UTC](https://forum.getkirby.com/t/router-problem-with-pattern-at-end-of-url/8277/8 "2025-02-06T17:23:17Z")

</div>


