To give some context, I initially started out with my api looking like this:
http://myserver/api.php?action=projects
In my api.php file I have
Change to this:
RewriteEngine On
RewriteRule ^action/([^/\.]+)/?$ api.php?action=$1 [L, QSA]
You need the QSA parameter to keep the querystring intact. So now this is possible:
/action/projects/?my=name
Or you can do this:
RewriteEngine On
RewriteRule ^action/([^/\.]+)/([^/\.]+)/?$ api.php?action=$1&method=$2 [L, QSA]
RewriteRule ^action/([^/\.]+)/?$ api.php?action=$1 [L, QSA]
Now you will have these urls:
/action/projects/add/
/action/projects/