Can't figure out how to create a dynamic route for the categories in this format:


That would bring the results from these slug categories.

Trying to build a complex query and I'm sure there is bound to be a better way of doing it that.

'news/<categories:.*>/<categorySlugs:{slug}(\-and\-{slug})+>' => ['template' => 'news/index']

1 Answer 1


Have you tried processing the entire slug directly in your template, without setting a complex route? Check for the presence of the string "-and-", split the slug accordingly, build a Category query.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.