我已经设置了相当多的Silex/Symfony应用程序,没有任何问题。我现在只需要使用htaccess功能就可以在共享域中工作。为Silex设置ModRewrite - 问题与路由
继Silex的文档上的设置,与周围的浏览一起,我建立了我的.htaccess如下: (http://silex.sensiolabs.org/doc/web_servers.html)
网站看起来像http://example.com/webpath/to/silex/
。该文件是在/drive/path/to/silex/.htaccess
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /webpath/to/silex/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)? web/index_dev.php/$1 [QSA,L]
</IfModule>
这似乎很好地工作,除了所有路由包括/ webpath /到/硅石/。 IE浏览器。持续NotFoundHttpException: No route found for "GET /webpath/to/silex/home"
错误。
我对mod_rewrite的体验很简单而且有限;我花了一段时间玩了规则和基地的运气,没有任何运气。
如何将URL的末尾传递给silex应用程序?