views:

93

answers:

1

I have admin routing enabled. How can I set routing, to make http://website.com/admin go to posts/admin_index?

I've got this:

Router::connect('/', array('controller' => 'posts', 'action' => 'index'));

But it doesn't seem to work. I get this error (when going to http://website.com/admin):

Missing Controller

Error: Controller could not be found.

Error: Create the class Controller below in file: app/controllers/controller.php

<?php
class Controller extends AppController {

    var $name = '';
}
?>
+3  A: 

Try a route with:

Router::connect('/admin', array('controller' => 'posts', 'action' => 'index', 'admin' => true));

The default route '/' does not match the URL '/admin', admin routing enabled or not.

deceze