Routes Silex路由不是';行不通

Routes Silex路由不是';行不通,routes,url-routing,silex,Routes,Url Routing,Silex,我在做一个Silex项目,我在路线方面遇到了麻烦 这项工作: $app->get('/', function () use ($app) { return $app['twig']->render('index.html', array()); }) ->bind('homepage'); 但这并不是: $app->get('/contact', function () use ($app) { return $app['twig']->rende

我在做一个Silex项目,我在路线方面遇到了麻烦

这项工作:

$app->get('/', function () use ($app) {
    return $app['twig']->render('index.html', array());
})
->bind('homepage');
但这并不是:

$app->get('/contact', function () use ($app) {
    return $app['twig']->render('contact.html', array());
})
->bind('contact');
阿帕奇说:找不到!!!,我不知道为什么第一个有效,但第二个无效


有什么想法吗?

我通过将
AllowOverride None
更改为
AllowOverride All

解决了这个问题。您是否启用了mod_rewrite并将其配置为将404路由到silex?事实上,你有一个apache 404,这表明情况并非如此。你输入的URL是什么?mod_rewrite已启用,URL try-你的路由是为该URL设置的,而不是web/联系人。这些路由都是相对于基本URL(在本例中为localhost)的。您是否遵循了此处的指南:for.htaccess