I have a SLIM project I have set up for a RESTful webs service. My project structure is as below:
-MyProject
-app
-logs
-public
-index.php
-.htaccess
-vendor
-composer.json
-composer.lock
So right now to access my routes I would need something like https://myuri/MyProject/public/endpoint
I want to remove the public directory from the url so my request looks more like https://myuri/MyProject/endpoint
I have tried adding an .htaccess
to my root directory:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/
RewriteRule ^(.*)$ /public/$1 [R=301,L]
I just get page not found. What is the best way to remove the public directory from the url?