title: ZF1 Zend_Controller_Router_Route optional segments
body: <p>I have some issues with Zend_Controller_Router_Route.
  I have the following url in standard module/controller/action notation:</p>
  
  <p><a href="http://www.mysite.com/rent/index/region/myregion/town/mytown/district/mydistrict/filter_params/filter_values" rel="nofollow">http://www.mysite.com/rent/index/region/myregion/town/mytown/district/mydistrict/filter_params/filter_values</a></p>
  
  <p>module: rent
  controller: index</p>
  
  <p>params: region, town, district</p>
  
  <p>filter_params are some more pagination params and drilldown stuff</p>
  
  <p>I want to strip it down to:
  <a href="http://www.mysite.com/rent/myregion/mytown/mydistrict/filter_params/filter_values/" rel="nofollow">http://www.mysite.com/rent/myregion/mytown/mydistrict/filter_params/filter_values/</a></p>
  
  <p>But these should also work</p>
  
  <p><a href="http://www.mysite.com/rent/myregion/mytown/filter_params/filter_values" rel="nofollow">http://www.mysite.com/rent/myregion/mytown/filter_params/filter_values</a></p>
  
  <p><a href="http://www.mysite.com/rent/myregion/filter_params/filter_values" rel="nofollow">http://www.mysite.com/rent/myregion/filter_params/filter_values</a></p>
  
  <p>I tried this route</p>
  
  <pre><code>$myRoute = new Zend_Controller_Router_Route(
      'rent/:region/:town/:district/*',
       array(
           'controller' =&gt; 'rent',
           'action' =&gt; 'index'
       )
  );
  $router-&gt;addRoute('rent', $myRoute);
  </code></pre>
  
  <p>This one works: 
  <a href="http://www.mysite.com/rent/myregion/mytown/mydistrict" rel="nofollow">http://www.mysite.com/rent/myregion/mytown/mydistrict</a></p>
  
  <p>these ones fail</p>
  
  <p><a href="http://www.mysite.com/rent/myregion/mytown" rel="nofollow">http://www.mysite.com/rent/myregion/mytown</a></p>
  
  <p><a href="http://www.mysite.com/rent/myregion" rel="nofollow">http://www.mysite.com/rent/myregion</a></p>
  
  <pre><code>Action 'myregion' does not exist and was not trappend in __call()
  </code></pre>
  
  <p>How can I declare the other routes and what will happen to all the other params, when i have a route like <a href="http://www.mysite.com/rent/myregion/mytown/filter_params/filter_values" rel="nofollow">http://www.mysite.com/rent/myregion/mytown/filter_params/filter_values</a></p>
  
  <p>Thank you for your help!</p>