When I call the home page with '/' everything works fine but when I call some other page, for instance '/register', I get Object not found!.
This is my code:
session_start();
require(__DIR__."/../vendor/autoload.php");
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$whoops->register();
$router= new AltoRouter();
$router->map('GET','/',function(){
include(__DIR__."/../views/home.php");
});
$router->map('GET','/register',function(){
include(__DIR__."/../views/register.php");
});
$router->map('GET','/login',function(){
include(__DIR__."/../views/login.php");
});
$match=$router->match();
if($match && is_callable($match['target'])){
call_user_func_array($match['target'],$match['params']);
}else{
header($_SERVER['SERVER_PROTOCOL'].'404 Not Found');
}