php – Silex路由.htaccess webroot

我正在使用Silex“微框架”来进行应用程序的路由.
我目前仍然坚持如何使用.htaccess重写网址.

标准Silex网址:localhost / myapp / web / index.PHP / hello / name

我希望它看起来像:localhost / myapp / hello / name

使用以下.htaccess代码,我可以省略/index.PHP/部分.但我仍然需要使用/ web / part.

RewriteEngine On
RewriteCond %{THE_REQUEST} /myapp/web/index.PHP/
RewriteRule ^/myapp/web/index.PHP/(.*) /myapp/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !/myapp/web/index.PHP/
RewriteRule ^(.*)$/myapp/web/index.PHP/$1 [L]

有什么建议?
谢谢!

解决方法:

我现在面临同样的问题,解决方案是将.htaccess内容更改为:

FallbackResource /index.PHP

所以在你的情况下它会

FallbackResource /web/index.PHP

这对我有用,我希望有人会发现它很有用.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...