Reputation: 1
I would like to rewrite the following URL:
mypage/1234/myaction?api_key=4567
to:
api/myaction.php?id=1234&api_key=4567
...using mod-rewrite. I can get /mypage/1234/myaction -> api/myaction.php?id=1234, but the extra get parameter is causing some problems....
Any ideas?
Upvotes: 0
Views: 150
Reputation: 97845
Use the QSA
(query string append) flag:
RewriteRule mypage/(\d+)/myaction api/myaction.php?id=$1 [QSA]
Upvotes: 2