次のようなものを渡したい(リダイレクトしない):
http://www.example.com/ (/ オプションあり) スクリプトに渡される http://www.example.com/index.php
http://www.example.com/foo/ (/ オプションで) スクリプトに渡される http://www.example.com/index.php?nav=foo
http://www.example.com/foo/bar (/ オプションあり) スクリプトに渡される http://www.example.com/index.php?nav=foo&subnav=bar
さらに、上記と同じパラメーターを使用して、サブドメインhttp://testumgebung.example.comをhttp://www.example.com/testumgebung.phpに渡したいと思います。
私は次のことをなんとかしましたが、ブラウザバーのURLを渡された場所に書き換え、以前のようにURLを残しません:
RewriteCond %{HTTP_HOST} ^testumgebung\.maskesuhren\.de
RewriteRule ^(.*)$ http://www.maskesuhren.de/$1/testumgebung.html [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/[^/]+/?$
RewriteRule ^([^/]*)/?$ index.html?nav=$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /.*/.*
RewriteRule ^([^/]*)/([^/]*)$ index.html?nav=$1&subnav=$2 [R,L]