Default route ('/') on a localhost

-

$router = new Phalcon\Mvc\Router(false);

$router->removeExtraSlashes(true);

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

$router->notFound(array(
    'controller' => 'index',
    'action' => 'page404'
));

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

return $router;

When accessing application without any route (http://localhost/myapp/) it shows notFound page (other routes work fine). If I use virtual host - everything works as expected. Any thoughts about that?

Strange behavior. I tested the routes on my localhost and everything works well. Do you use any .htaccess files?



10.3k

Yep, created project with devtools. Must be something wrong with apache cfg...



933

Bump!

Anyone on this!? chebureque, did you manage to sort this out?



10.3k
edited Jun '14

@Eduardo, actually not. I've reinstalled web-server and problem persists.

UPD: workaround for this - remove notFound route from router and handle it in dispatcher (docs)