I am implementing an Admin module, which contains the following routes:
'router' => array(
'routes' => array(
'admin' => array(
'type' => 'Zend\Mvc\Router\Http\Hostname',
'options' => array(
'route' => ':subdomain.mydomain.local',
'constraints' => array(
'subdomain' => 'admin',
),
'defaults' => array(
'module' => '__NAMESPACE__',
'controller' => 'Admin\Controller\Index',
'action' => 'index',
),
),
'priority' => 9000,
'may_terminate' => true,
'child_routes' => array(
'users' => array(
'type' => 'Zend\Mvc\Router\Http\Literal',
'options' => array(
'route' => '/users',
'defaults' => array(
'module' => '__NAMESPACE__',
'controller' => 'Admin\Controller\Users',
'action' => 'index',
),
),
),
)
),
),
),
And this is the home route configuration:
'home' => array(
'type' => 'Zend\Mvc\Router\Http\Literal',
'options' => array(
'route' => '/',
'defaults' => array(
'controller' => 'Application\Controller\Index',
'action' => 'index',
),
),
),
When I try to access to http://admin.mydomain.com, the route match always
with the homeroute, but if I remove all the child routes from the admin
route, the behavior is correct and a http://admin.mydomain.com matches with
the admin route. Obviously I am missing something but I don't know what
after trying all options and reading carefully the reference guide. Hope
somebody can help :)
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Zend-hostname-route-doesn-t-match-when-it-has-child-routes-tp4661992.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]