title: Zend Framework 2 (ZF2) 404 Page not found error when calling action
body: <p>I have started from the <a href="https://github.com/zendframework/ZendSkeletonApplication" rel="nofollow">ZF2 Skeleton Application</a>. I have a module called <code>Application</code>. Inside that module I have added my own <code>ShopController</code>. It is registered in the <code>module.config.php</code> which looks like this.</p>
  
  <pre><code>return array(
      'router' =&gt; array(
          'routes' =&gt; array(
              'home' =&gt; array(
                  'type' =&gt; 'Zend\Mvc\Router\Http\Literal',
                  'options' =&gt; array(
                      'route'    =&gt; '/',
                      'defaults' =&gt; array(
                          'controller' =&gt; 'Application\Controller\Index',
                          'action'     =&gt; 'index',
                      ),
                  ),
              ),
              'application' =&gt; array(
                  'type'    =&gt; 'Literal',
                  'options' =&gt; array(
                      'route'    =&gt; '/application',
                      'defaults' =&gt; array(
                          '__NAMESPACE__' =&gt; 'Application\Controller',
                          'controller'    =&gt; 'Index',
                          'action'        =&gt; 'index',
                      ),
                  ),
                  'may_terminate' =&gt; true,
                  'child_routes' =&gt; array(
                      'default' =&gt; array(
                          'type'    =&gt; 'Segment',
                          'options' =&gt; array(
                              'route'    =&gt; '/[:controller[/:action]]',
                              'constraints' =&gt; array(
                                  'controller' =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                                  'action'     =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                              ),
                              'defaults' =&gt; array(
                              ),
                          ),
                      ),
                  ),
              ),
              'shop' =&gt; array(
                      'type'    =&gt; 'segment',
                      'options' =&gt; array(
                              'route'    =&gt; '/shop[/][:action][/:id]',
                              'constraints' =&gt; array(
                                      'action' =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                                      'id'     =&gt; '[0-9]+',
                              ),
                              'defaults' =&gt; array(
                                      '__NAMESPACE__' =&gt; 'Application\Controller',
                                      'controller'    =&gt; 'Shop',
                                      'action'        =&gt; 'index',
                              ),
                              'child_routes' =&gt; array(
                                      'default' =&gt; array(
                                              'type'    =&gt; 'Segment',
                                              'options' =&gt; array(
                                                      'route'    =&gt; '/[:controller[/:action]]',
                                                      'constraints' =&gt; array(
                                                              'controller' =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                                                              'action'     =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                                                      ),
                                                      'defaults' =&gt; array(
                                                      ),
                                              ),
                                      ),
                              ),
                      ),
              ),
          ),
      ),
      'controllers' =&gt; array(
          'invokables' =&gt; array(
              'Application\Controller\Index' =&gt; 'Application\Controller\IndexController',
              'Application\Controller\Shop' =&gt; 'Application\Controller\ShopController',
          ),
      ),
      [... service_manager,translator,view_manager as in skeleton app ...]
  );
  </code></pre>
  
  <p>I can reach the shop controller's index action by browsing to my.example.com/shop/ but when I try to reach a different action, e.g. my.example.com/shop/add it doesn't work. I get a 404.</p>
  
  <p>What am I missing?</p>