我有这样的申请入口点。
/app/index.php <-- this is the main dispatcher.
和/app下的特定于应用程序的文件夹/
/app/todo/
/app/calendar/
/app/bugtrack/
每个应用程序文件夹包含特定于应用程序的文件。
我想通过app下面的所有请求来通过/app/index.php。
以便。
/app/todo/list/today -> goes to /app/index.php
/app/ -> goes to /app/index.php
/app/bugtrack/anything/else goes to /app/index.php
在我的LightTPD测试机上,我可以通过编写这样的规则轻松地完成它。
url.rewrite-once = (
"^\/app\/todo\/*" => "/app/index.php",
"^\/app\/calendar\/*" => "/app/index.php",
"^\/app\/bugtrack\/*" => "/app/index.php",
)
现在需要让它在使用.htaccess和mod重写的Apache上工作。
但不管我做什么,它都不起作用。
我在/app/.htaccess中编写了以下内容
RewriteEngine on
RewriteRule .* index.php [QSA]
例如,它适用于/app/和/app/todo/,但不适用于/app/todo/list/today。
有人能告诉我怎么做吗?