I have a /api/
folder under my web root, with a file called api.php
.
When making requests to locahost/api/
I want it to be mapped to localhost/api/api.php
so that I can do HTTP requests like this: GET localhost/api/movie/1
instead of having to request localhost/api/api.php/movie/1
.
Here is my current attempt:
Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^api/([^/]+)/?$ /api/api.php/$1 [L]
However, it just gives me a 404 on the requests.
Please help a brother out.