【发布时间】:2009-04-22 18:36:40
【问题描述】:
我的应用程序入口点是这样的。
/app/index.php <-- this is the main dispatcher.
以及 /app/ 下的应用程序特定文件夹
/app/todo/
/app/calendar/
/app/bugtrack/
每个应用程序文件夹都包含应用程序特定的文件。
我想通过/app/index.php传递app下的所有请求。
这样。
/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_rewrite 使其在 Apache 上工作。
但无论我做什么,它都不起作用。
我在 /app/.htaccess 中写了以下内容
RewriteEngine on
RewriteRule .* index.php [QSA]
例如,它适用于 /app/ 和 /app/todo/,但对于 /app/todo/list/today 无效。
谁能告诉我怎么做?
【问题讨论】:
标签: apache mod-rewrite lighttpd