title: Zend: Cannot get router working from Bootstrap.php
body: <p>New to Zend and having a problem with routing.</p>
  
  <p>I can get routing working using the application.ini file but cannot seem to get routing working using the bootstrap. I have looked at quite a few tutorials but most seem to apply to older versions of Zend Framework. I am using 1.10.</p>
  
  <p>In my Bootstrap I have:</p>
  
  <pre><code>class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
  {
      protected function _initRouter()
      {
          $frontController = Zend_Controller_Front::getInstance();
          $router = $frontController-&gt;getRouter();
          $route = new Zend_Controller_Router_Route(
              'aaa',
              array(
                  'controller' =&gt; 'index',
                  'action'     =&gt; 'browse'
              )
          );
          $router-&gt;addRoute('test', $route);
      }
  }
  </code></pre>
  
  <p>And my index.php</p>
  
  <pre><code>// Define path to application directory
  defined('APPLICATION_PATH')
      || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
  
  // Define application environment
  defined('APPLICATION_ENV')
      || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
  
  // Ensure library/ is on include_path
  set_include_path(implode(PATH_SEPARATOR, array(
      realpath(APPLICATION_PATH . '/../library'),
      get_include_path(),
  )));
  
  /** Zend_Application */
  require_once 'Zend/Application.php';
  
  // Create application, bootstrap, and run
  $application = new Zend_Application(
      APPLICATION_ENV,
      APPLICATION_PATH . '/configs/application.ini'
  );
  
  $application-&gt;bootstrap()
              -&gt;run();
  </code></pre>
  
  <p>If I point my browser to <a href="http://www.mysite.com/aaa" rel="nofollow">http://www.mysite.com/aaa</a></p>
  
  <p>I get the following error</p>
  
  <pre><code>An error occurred
  Page not found
  Exception information:
  
  Message: Invalid controller specified (aaa)
  Stack trace:
  
  #0 /usr/share/php/libzend-framework-php/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard-&gt;dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
  #1 /usr/share/php/libzend-framework-php/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front-&gt;dispatch()
  #2 /usr/share/php/libzend-framework-php/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap-&gt;run()
  #3 /var/www/mysite.com/directory001/public/index.php(26): Zend_Application-&gt;run()
  #4 {main}  
  
  Request Parameters:
  
  array (
    'controller' =&gt; 'aaa',
    'action' =&gt; 'index',
    'module' =&gt; 'default',
  ) 
  </code></pre>
  
  <p>This seems so straight forward but does not seem to work.</p>
  
  <p>Can anybody see what I might be doing wrong?</p>