Root Route is always points to IndexController

As I see in Phosphorum source, routes.php, it points '/' route to Discussions::index

$router->add('/', array(
    'controller' => 'discussions',
    'action' => 'index'
));

So I did the same in my App, but somehow it always route http://localhost/ to IndexController. How can it be?

Another question, as I understood I can't delete IndexController, even I don't need it, right?

Nope, it was enabled. Thanks for notify me, I'm just don't know about this argument, and missed it when looking at code. But when default routes was disabled - nothing changed.

edited Oct '14

I tried to set defaults:

//Using an array
$router->setDefaults(array(
            "controller" => "board",
            "action" => "index"
));

This way it works, but another routes which is not in list of routes for example http://localhost/qwerty is also go to homepage instead of throwing 404.



82.7k

Can you post please the part of the app that is not working on a gist? or github?

edited Oct '14

Here is desired route:

$router->add("/", array(
            'controller' => 'board',
            'action' => 'index'
));

But when I go http://localhost or http://localhost/ it gets an infinite loop of redirections...



82.7k

Are you still having problems with this?