次のURLを変換したい:
http://localhost/index.php?foo=bar&bar=foo
の中へ:
http://localhost/index/bar/foo
つまり、ページ拡張子をスラッシュに置き換えてから、1 つ以上の変数を再帰的に書き換えたいと考えています。
これは可能ですか?
次のURLを変換したい:
http://localhost/index.php?foo=bar&bar=foo
の中へ:
http://localhost/index/bar/foo
つまり、ページ拡張子をスラッシュに置き換えてから、1 つ以上の変数を再帰的に書き換えたいと考えています。
これは可能ですか?
# to redirect the browser to friendly
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\?foo=([^&]+)&bar=([^&\ ]+)
RewriteRule ^ /index/%1/%2? [L,R=301]
# to internally rewrite friendly back to the proper resource
RewriteRule ^/?index/([^/]+)/([^/]+)$ /index.php?foo=$1&bar=$2 [L,QSA]