Unfortunately the (:all?)-Selector doesnt work at all
Due to :all, :any… are special kirby selectors they don’t seem work with regular expressions together.
You can try something like this.
But havn’t tested this one specifically.
$kirby->set('route', [
'pattern' => '(?:(^[a-z]{2})//?)?faq/(:all)',
'method' => 'ALL',
'action' => function($lang, $path) {
faq_router_handler($lang, $path);
// or if you need to set a default language
faq_router_handler($lang ?? 'en', $path);
}
]);
That’s bizarre. I wrote the optional (:all?) down in my notes at the Kirby workshop as a solution @bastianallgeier mentioned to fix my duplicate routes issue I had.
I don’t have the time to look into this right now, but indeed it doesn’t seem to work as expected.