I have entry which has route like this:


There can be an unspecified number of categories - these are multilevel structure entries.

I want to add an entry edit page on the frontend. This page would have URL like this:


How do I create route for this? In routes.php file, I need to put specific route segments into an array - how do I set "unspecified number of category segments"?

I fount on some Yii related forum information that it can be done using (.*) wildards, so i tried this:


But it didnt worked.

  • This comment evades the question but the architecture feels problematic to me. If categories change, and thus URIs will change, and you then have content that doesn't have its special Universal Resource Identifier without ongoing change management. Commented May 19, 2020 at 19:01
  • 3
    More to the question, I would ask, is the number of categories truly infinite? If not, maybe you just need an upper limit and to configure several routes that handle each case using wildcards (.*) as segments in decreasing specificity to represent the different patterns you would need to handle. Commented May 19, 2020 at 19:02


Your Answer

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

Browse other questions tagged or ask your own question.