I am creating a rest api endpoint to input data into a database. I have been trying to rewrite the url into this format http://example.com/src/public/endpoint/data
. The public in the url is a folder that had has an index.php file that all the urls will be routed to but it is not working. Below is my .htaccess code.
RewriteEngine
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://example.com/src/public/index.php?path=$1 [NC,L,QSA]
I am getting the link address http://example.com/src/public/?path=state/127&_=1579497796272
as the endpoint when i expect example.com/src/public/state/127
. I know am not doing something correctly but i can not figure it out.