すべてのリクエスト URL を .htaccess というファイルに渡す.htaccessファイルをセットアップしようとしGETていますindex.php。唯一の例外は、リクエスト URL がディレクトリresを指している場合です。
例:
/wiki/cool-stuff => index.php?uri=/wiki/cool-stuff
/wiki/cool-stuff?news=on => index.php?uri=/wiki/cool-stuff&news=on
/res/cool-photo.jpg => res/cool-photo.jpg
2 つの問題:
/wiki/cool-stuff2 番目の例で渡された GET 変数は、 index.phpには渡されません。- アクセスすると
/res(そうではありません/res/!!)/res/?uri=res、突然ブラウザに表示され、index.phpがuri=res/./res/代わりにアクセスすると、 index.phpがuri=res/表示され、ブラウザの URL はそのままになります (これで問題ありません)。
.htaccess : _
RewriteEngine on
RewriteBase /subthing/
RewriteCond %{REQUEST_URI} !/res/(.+)$
RewriteCond %{REQUEST_URI} !index.php
RewriteRule (.*) index.php?uri=$1
どうすれば望ましい動作を実現できますか?