这是我第一次玩Silex。我尝试了一个'/'路线,在GET和POST,并且一切正常。现在我试图让更复杂的要求:为什么Silex返回“在此服务器上未找到请求的URL/home”。错误信息?
<?php
require_once __DIR__ . '/../vendor/autoload.php';
$app = new Silex\Application();
$app->get(
'/home',
function() use ($app) {
return 'Homepage';
}
);
$app->run();
“/家”路线返回“请求的URL /家在此服务器上找到。”为什么?
这是我的.htaccess:
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FIOLNAME} !-f
RewriteRule^index.php [L]
“/index.php/home” 作品
嗯的.htaccess存在。我已更新我的问题。但仍不工作路线没有“index.php” – sensorario
我想这意味着我在我的机器配置不好。 – sensorario
确保在Apache中启用了“mod_rewrite”,并且“AllowOverride”已正确配置为可以读取您的“.htaccess” – xmarcos