For one of my templates, I need two extra segments.

If I have the following in template routes, the page only loads if there is 1 segment.


If I add the following, it fails:


The following works for two or one extra segment, but not just /gallery.


Can anyone explain how I can have it work for all segments:


1 Answer 1


If you have the segments required? flag in the template manager is set to "no", then your longest route (i.e. /gallery/{alpha_dash}/{alpha_dash}) should work for all your test cases. If it doesn't, try turning the two alpha_dash instances into separate variables - e.g. /gallery/{a:alpha_dash}/{b:alpha_dash}

  • Hi Gavin. Segments required is set to 'no'. As I explain in my question, I already tried /gallery/{alpha_dash}/{alpha_dash} and /gallery/{a:alpha_dash}/{b:alpha_dash} with neither working. Am I to understand that this means there is a bug?
    – ccdavies
    Sep 19, 2016 at 18:53
  • Hi ccdavies - you didn't say in your posting that you had tried setting the segments required to 'no'... Based on the documentation here the long form should work docs.expressionengine.com/v2/urls/template_routes.html Sep 20, 2016 at 0:25

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.