【发布时间】:2014-06-08 01:18:11
【问题描述】:
我在我的 xampp 安装中安装了 silex。
我使用下面的.htaccess
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /Test/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
当我访问时
http://localhost/Test/web
我得到了预期的输出,但是当我访问时
http://localhost/Test
我会从 silex 收到以下错误
NotFoundHttpException:找不到“GET /Test/”的路由
路线当然在那里。似乎它认为我想访问路由“/Test”而不是“/”。知道为什么该文件夹仍然通过,即使我已经在 .htaccess 中设置了相应的重写基础?
【问题讨论】:
标签: php .htaccess symfony mod-rewrite silex