Hello everyone, I’m trying to set up a route but I can’t make work the same pattern for multisite urls. Here is the code:
$kirby->set('route',[
'pattern' => '(:any)/download/([a-f0-9]{32})',
'action' => function($page_uri, $hash) {
if ($file = page($page_uri)->files()->findBy('hash', $hash)) {
$filename = $file->url();
return go($filename);
}
return go('/');
}
]);
This works fine for a default language url like www.website.com/some-page/download/[hash] but it doesn’t work for a url like www.website.com/es/some-page/download/[hash].
I’ve tried adding another placeholder for the language but since my default language url doesn’t contains /en for instance it doesn’t work.
Any ideas on how to solve this?