.htaccess - RewriteRule that preserves GET parameters -


what wrong rewrite rule?

rewriterule ^api/(.+)$ api/index.php?url=$1 [l] 

i want "index.php?url=" added after api/ , before rest of parameters.

api/image/upload&arg1=1&text=lorem+ipsum 

to

api/index.php?url=image/upload&arg1=1&text=lorem+ipsum 

what wrong (.+) after api/?

the regex on rewriterule run against path part of url, not query parameters. fortunately there [qsa] flag preserve existing query parameters.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -