views:

12

answers:

1

Hi, 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?

+1  A: 

Use the QSA (query string append) flag:

RewriteRule mypage/(\d+)/myaction api/myaction.php?id=$1 [QSA]
Artefacto