I have site I am running on localhost http://example
and I have directory in the root that contains my api so it's http://example/api
In the api
folder I have my root directory for the api which is public
directory. so /api/public/...
.
I want to have a .htaccess that redirects the user to the public
directory when they hit http://example/api/{api parameters}
. So I can have a clean url without having to write this http://example/api/public/{api parameters}
I tried this but to no avail
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/api
RewriteRule ^api/(.*) /api/public/$1 [L]
I got the above from a SO post but still could not get it to work.