Zend custom route not being recognized for controller <p>I'm creating a controller which will pull information of a painter from a database and display it: <code>PainterController</code>. I have defined it like so:</p> <pre><code>&lt;?php class PainterController extends Zend_Controller_Action { public function init() { //setup painter route $router = $this-&gt;getFrontController()-&gt;getRouter(); $router-&gt;addRoute( 'painter', new Zend_Controller_Router_Route( 'painter/:id', array( 'controller' =&gt; 'painter', 'action' =&gt; 'info' ) ) ); } public function indexAction() { //index } public function infoAction() { //info was requested for given ID } } ?&gt; </code></pre> <p>As you can see, a route is setup to accept anything like <code>domain.com/painter/12</code> where in this example the id 12 is passed to the infoAction.</p> <p>Yet, when I visit such URL I the route is not being recognized, instead I get:</p> <pre><code>Message: Action "2" does not exist and was not trapped in __call() Stack trace: #0 /home/httpd/vhosts/xxx.com/subdomains/peter/httpdocs/library/Zend/Controller/Action.php(515): Zend_Controller_Action-&gt;__call('2Action', Array) #1 /home/httpd/vhosts/xxx.com/subdomains/peter/httpdocs/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action-&gt;dispatch('2Action') #2 /home/httpd/vhosts/xxx.com/subdomains/peter/httpdocs/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard-&gt;dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #3 /home/httpd/vhosts/xxx.com/subdomains/peter/httpdocs/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front-&gt;dispatch() #4 /home/httpd/vhosts/xxx.com/subdomains/peter/httpdocs/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap-&gt;run() #5 /home/httpd/vhosts/xxx.com/subdomains/peter/httpdocs/public/index.php(25): Zend_Application-&gt;run() #6 {main} Request Parameters: array ( 'controller' =&gt; 'painter', 'action' =&gt; '2', 'module' =&gt; 'default', ) </code></pre> <p>Does anyone have a clue on why this would happen?</p> <p><em>(FYI, I realize that the files are located in a public directory, this is due to a shared webhost constraint. The files are protected using .htaccess. This is unrelated to the question.)</em></p> <p><strong>Update: it appears that the above does work when defined in the bootstrap. However, I do not like to put a lot of logic in the bootstrap. Is it possible to define controller related routes inside the controller itself?</strong></p>