5.7. Default routes
Prev | Chapter 5. Zend_Controller_RewriteRouter | Next

## 5.7. Default routes

Zend_Controller_RewriteRouter is preconfigured with two default routes. The first handles your root URL and is mapped to indexAction of IndexController: so you have to provide them as outlined in the Section 4.2, “Getting Started” (see Section 4.2.5, “IndexController”). The second default route is included to provide compatibility with the first version of the router. It will match URIs in the shape of `'controller/action'`.

Default rules are configured as:

    // Default route for root URL
    $this->addRoute('default', '', array('controller' => 'index', 'action' => 'index'));

    // Route for Router v1 compatibility
    $this->addRoute('compat', ':controller/:action', array('controller' => 'index', 'action' => 'index'));

| Note
Though Zend_Controller_RewriteRouter is configured for backwards compatibility it will not match `controller/action` URIs with additional parameters just yet.

Prev | Up | Next
5.6. Base URL and subdirectories | Home | Chapter 6. Zend_Db