Route redirect url with params

HI, I’m trying to redirect urls with params to a specific page. After a website redesign with kirby I have alot of url params to redirect.
I’ve tried something like

  array(
    'pattern' => '?id=10',
    'method' => 'GET',
    'action' => function () {
      header::redirect(kirby()->site()->url(). '/kontakt', 301);
    }
  ),

for normal pages without params it works just fine.
How can I redirect these kind of params? Thanks for your support.

Routes do not work with params, see docs: https://getkirby.com/docs/toolkit/api/helpers/params.

Edit: You could try do do this via your server config or .htaccess file, see this answer on serverfault.com.

Thanks alot. I’ll try to find a solution.