title: ZF2 routing configuration
body: <p>I've just built a zf2 project and i'm having a configuration problem.</p>
  
  <p>When i go to mydomain.com this routs as specified in configuration files to Application module, index controller, index action.</p>
  
  <p>But If i type mydomain.com/otheraction this is not routed to Application module, index controller, otheraction action. Of course, since it isn't configured to do this. </p>
  
  <p>So my question would be how do i configure the app to do that? I've added my Application/config/module.config.php file and the main config file. Thank you!</p>
  
  <p><strong>module.config.php</strong></p>
  
  <pre><code>    &lt;?php
  /**
   * Zend Framework (http://framework.zend.com/)
   *
   * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
   * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
   * @license   http://framework.zend.com/license/new-bsd New BSD License
   */
  
  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',
                      ),
                  ),
              ),
              // The following is a route to simplify getting started creating
              // new controllers and actions without needing to create a new
              // module. Simply drop new controllers in, and you can access them
              // using the path /application/:controller/:action
              '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(
                              ),
                          ),
                      ),
                  ),
              ),
          ),
      ),
      'service_manager' =&gt; array(
          'factories' =&gt; array(
              'translator' =&gt; 'Zend\I18n\Translator\TranslatorServiceFactory',
          ),
      ),
      'translator' =&gt; array(
          'locale' =&gt; 'en_US',
          'translation_file_patterns' =&gt; array(
              array(
                  'type'     =&gt; 'gettext',
                  'base_dir' =&gt; __DIR__ . '/../language',
                  'pattern'  =&gt; '%s.mo',
              ),
          ),
      ),
      'controllers' =&gt; array(
          'invokables' =&gt; array(
              'Application\Controller\Index' =&gt; 'Application\Controller\IndexController'
          ),
      ),
      'view_manager' =&gt; array(
          'display_not_found_reason' =&gt; true,
          'display_exceptions'       =&gt; true,
          'doctype'                  =&gt; 'HTML5',
          'not_found_template'       =&gt; 'error/404',
          'exception_template'       =&gt; 'error/index',
          'template_map' =&gt; array(
              'layout/layout'           =&gt; __DIR__ . '/../view/layout/layout.phtml',
              'application/index/index' =&gt; __DIR__ . '/../view/application/index/index.phtml',
              'error/404'               =&gt; __DIR__ . '/../view/error/404.phtml',
              'error/index'             =&gt; __DIR__ . '/../view/error/index.phtml',
          ),
          'template_path_stack' =&gt; array(
              __DIR__ . '/../view',
          ),
      ),
  );
  </code></pre>
  
  <p><strong>application.config.php</strong></p>
  
  <pre><code>&lt;?php
  return array(
      'modules' =&gt; array(
          'Application',
          'ZfcBase',
          'ZfcUser',
      ),
      'module_listener_options' =&gt; array(
          'config_glob_paths'    =&gt; array(
              'config/autoload/{,*.}{global,local}.php',
          ),
          'module_paths' =&gt; array(
              './module',
              './vendor',
          ),
      ),
  );
  </code></pre>