Routes to fake a Structure I'm building a site with loads of complex itineraries. Entries are in a channel for various reasons, but I want to split the data across subpages, with a URL structure like:

/itinerary/name-of-itinerary
/itinerary/name-of-itinerary/dates-prices
/itinerary/name-of-itinerary/gallery
/itinerary/name-of-itinerary/etc...


I want to route everything through my _views/itinerary/index template, and then just have a bunch of includes (dates-prices, gallery, etc...) in my index, something like:

{% include ( '_views/itinerary/' ~ craft.request.lastSegment ) %}


In my routes.php I've got:

'itinerary\/(?P&lt;slug&gt;[^\/]+)\/([^\/]+)'                 =&gt; '_views/itinerary',
'itinerary\/(?P&lt;slug&gt;[^\/]+)'                           =&gt; '_views/itinerary',


So everything is routing fine to _views/itinerary/index. Trouble is, I get a 404 for anything other than /itinerary/name-of-itinerary because Craft uses the last segment to resolve the entry, which is exactly what you'd want normally. But if the last segment is 'dates-prices' or 'gallery' I'm screwed.

Have I set this up right? Is there a more efficient and complete way? Any help much appreciated.
The route/template for '/itinerary/name-of-itinerary' will be defined in the section's settings, so it's the others you need to deal with.

I'd add this route to your routes.php file:

'itinerary/(?P&lt;entrySlug&gt;[-\w]+)/(?P&lt;subpageSlug&gt;(dates-prices|gallery|etc))' =&gt; '_views/itinerary/index',


And then in '_views/itinerary/index' I'd include these conditionals:

{% if entry is not defined %}
    {% set entry = craft.entries.section('itineraries').slug(entrySlug).first() %}
{% endif %}

{% if not entry %}
    {% exit 404 %}
{% endif %}


On your subpages, the entry model object won't be available by default so you need to check whether it's defined, and if not define it.