このようなアプリケーション エントリ ポイントがあります。
/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_rewrite を使用して Apache で動作させる必要があります。
しかし、私が何をしても、うまくいきません。
/app/.htaccess に以下を書きました
RewriteEngine on
RewriteRule .* index.php [QSA]
/app/ と /app/todo/ では機能しますが、たとえば /app/todo/list/today では失敗します。
誰でもそれを行う方法を教えてもらえますか?