Answers.Body: <p>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. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-31T07:22:41.617Z
Answers.LastActivityDate: 2019-05-31T07:22:41.617Z
Answers.UserDisplayName: gioppe
Body: <p>Can't figure out how to create a dynamic route for the categories in this format:</p>
  
  <pre><code>site.com/news/category-1-and-category-2-and-category-3 
  </code></pre>
  
  <p>That would bring the results from these slug categories.</p>
  
  <p>Trying to build a complex query and I'm sure there is bound to be a better way of doing it that.</p>
  
  <pre><code>'news/&lt;categories:.*&gt;/&lt;categorySlugs:{slug}(\-and\-{slug})+&gt;' =&gt; ['template' =&gt; 'news/index']
  </code></pre>
  
Tags: <search><routes><slug>
Title: How to make a multiple route?
ThreadText: # How to make a multiple route?
  
  (Asked by: username_0 on 2019-05-27)
  
  Can't figure out how to create a dynamic route for the categories in this format:
  
  ```
  site.com/news/category-1-and-category-2-and-category-3 
  
  ```
  
  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']
  
  ```
  
  **Tags:** search, routes, slug
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-31. Score: 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.
  
  
  ---
  
  