Somehow i could nowhere find a solution how to convert
https://example.com/api/command
to
https://example.com/api?command
in a .htaccess-file. Anyone a quick solution to this? It should only internally redirect.
Here what does not work:
RewriteEngine On
RewriteRule ^api/(.*)?$ api?$1 [NC,QSA]
Have your htaccess file in following way, written and tested with shown samples. Also please make sure you clear your browser cache before testing your URLs.
RewriteEngine ON
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(api)/(.*)/? $1?$2 [NC,L]