title: Zend Framework: How to map fully dynamic route
body: <p>The title of this question was hard to come up with, it might not be the best, anyway.</p>
  
  <p>I have a site with regions, categories and suppliers, the obvious solution is to use the default route of</p>
  
  <pre><code>"/:module/:controller/:action"
  </code></pre>
  
  <p>So that my URLs will look something like this</p>
  
  <pre><code>"/region/midlands/category/fashion"
  "/region/midlands/supplier/ted-baker"
  </code></pre>
  
  <p>What I want to achieve is a URL format like this however, this would need to involve a database query to check for the existence of <code>midlands</code>, <code>fashion</code> and <code>ted-baker</code></p>
  
  <pre><code>"/midlands/fashion"
  "/midlands/ted-baker"
  </code></pre>
  
  <p>My original solution was to use something like this</p>
  
  <pre><code>"/region/midlands/fashion"
  </code></pre>
  
  <p>With a route defined as </p>
  
  <pre><code>routes.category.route = "/region/:region/:category"
  routes.category.defaults.controller = category
  routes.category.defaults.action = index
  routes.category.defaults.module = default
  routes.category.defaults.category = false
  routes.category.defaults.region = false
  
  routes.supplier.route = "/supplier/:supplier"
  routes.supplier.defaults.controller = supplier
  routes.supplier.defaults.action = index
  routes.supplier.defaults.module = default
  routes.supplier.defaults.supplier = false
  </code></pre>
  
  <p>But that means prefixing everything with <code>region</code> or <code>supplier</code>. I almost need to hijack the request completely with a plug in?</p>
  
  <p>What is the best way of achieving this?</p>
  
  <p>Thanks for any help.</p>
  
  <p><strong>Edit.</strong></p>
  
  <p>@St.Woland, the problem is that I want this route </p>
  
  <pre><code>/:region/:supplier
  </code></pre>
  
  <p>To work with this URL</p>
  
  <pre><code>/midlands/ted-baker
  </code></pre>
  
  <p>But that route effectively overrides the default router</p>