ZF-7499: Zend_Controller_Router_Route_Regex won't follow ->chain

Issue Type: Bug Created: 2009-08-06T01:08:45.000+0000 Last Updated: 2012-11-20T20:52:42.000+0000 Status: Closed Fix version(s): Reporter: Adam L (adam_lj) Assignee: None Tags: - Zend_Controller

Related issues: Attachments:


I upgraded to 1.9 and found out that my site wasn't working properly. I found out this is because a Regex on one of my domains connected to the ZF system is also in effect on the other domain.

Trying to access /controller/action/param/teststring on domain2 works. But when I try to access /controller/action/param/123 (note that this is a number matching the regex) on domain2 then the regex rule in the code (for domain1) goes in to effect and the routing works unexpectedly.

I guess the chain() function applies the regex to all domains not just the specified domain as before.

My rewrite configuration looks like this:

<pre class="highlight">
$router = $frontController->getRouter ();

$domain1= new Zend_Controller_Router_Route_Hostname(
        'module' => 'domain',
        'domain' => '([a-z0-9]+)',
$router->addRoute('Pagination', $domain1->chain(new Zend_Controller_Router_Route_Regex ( '(.+)/(\d+)', 
    array ('controller' => 'page', 'action' => 'index'),array(1=> 'permalink', 2 => 'page')

$domain2 = new Zend_Controller_Router_Route_Hostname(
        'module' => 'admin',
$router->addRoute('Admin', $domain2->chain(new Zend_Controller_Router_Route(
    ':controller/:action/*', array('controller' => 'index', 'action' => 'index')


Posted by Rob Allen (rob) on 2012-11-20T20:52:42.000+0000

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.