What is wrong with this rewrite rule?
RewriteRule ^api/(.+)$ api/index.php?url=$1 [L]
I simply want \"index.php?url=\" to be added after ap
Are you doing something to stop infinite recursion?
RewriteRule ^api/(.+)$ api/index.php?url=$1 [R=301,L]
or some equivalent
I think you must write your domain name before the regex stuff. Like this:
RewriteRule ^(.+).com/api/(.*)$ "$1.com/api/index.php?url=$2" [R=301,L]
The regex on the RewriteRule is only run against the path part of the URL, not the query parameters. Fortunately there is the [QSA] flag to preserve existing query parameters.