.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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -