我正在使用微框架Silex构建一个项目,在我的本地主机上我使用的是 Apache 2.2.22 这是结构:
/var/www/ProjectName/
vendor/
web/
.htaccess
index.php
在我的 .htacces 中有:
FallbackResource /index.php
主页运行良好,但是当我尝试访问需要重写 URL 的页面时,我得到了 404。这是第二个控制器的代码:
$app->get('/view/{token}', function (Request $request, $token) use ($app, $db) {
echo 'ok';exit;
return $app['twig']->render('home.twig.html');
})
->bind('view');
我做错了什么?