How to access query string parameters after “Cleaning” your PHP REST API?

前端 未结 2 650
青春惊慌失措
青春惊慌失措 2021-01-24 12:51

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

2条回答
  •  情话喂你
    2021-01-24 13:38

    You can use these rules:

    RewriteEngine On
    
    RewriteRule ^(?:action|api\.php)/([^/.]+)/?$ api.php?action=$1 [L,NC,QSA]
    

提交回复
热议问题