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
You can use these rules:
RewriteEngine On RewriteRule ^(?:action|api\.php)/([^/.]+)/?$ api.php?action=$1 [L,NC,QSA]