2011-11-09 8 views
0

誰でも助けてくれますか?.htaccessでリダイレクトしてパラメータを取得する

私はこのようなGETパラメータで要求をリダイレクトする必要があります。

http://www.mysite.com/listings/?tx_listingcontroller[countryId]=4&tx_listingcontroller[regionId]=2868&cHash=f59c2ae1b037df6fc8a1e2a55ea0ee96 

http://www.mynewsite.com/listings/countryId/4/regionId/2868/cHash/f59c2ae1b037df6fc8a1e2a55ea0ee96 

に誰もが、私はこれを行うことができます方法を知っていますか?

ありがとうございます!

+0

http://stackoverflow.com/questions/1179868/rewriting-query-string-using-mod-rewriteを参照してください。 – reinierpost

答えて

1

.htaccessファイルにRewriteRuleを追加できます。 http://httpd.apache.org/docs/current/mod/mod_rewrite.html。これは、RegExを使用して着信URLを解析し、一致するセグメントに基づいて新しいURLにリダイレクトします。以下のような何か...

RewriteRule ^listings/?tx_listingcontroller[countryId]=(.*)&tx_listingcontroller[regionId]=(.*)&cHash=(.*)$ listings/countryId/$1/regionId/$2/cHash/$3

関連する問題