How to deploy slim4 to apache server subfolder?

So I am almost done with my new Slim 4 API and i am trying to move it from xampp to a live server. I am using a shared server and the app will go to a subfolder with the following structure:

public_html/ (this contains all the files).

I tried moving it and creating an .htaccess with this:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

But doesnt seem to work (404 error). What am i doing wrong?

This is the complete error i get:

[23-Apr-2020 11:08:41 CST6CDT] 404 Not Found
Type: Slim\Exception\HttpNotFoundException
Code: 404
Message: Not found.
File: /home/tours/public_html/
Line: 93

Try following the tutorial here:

It has helped me deploy my Slim API

1 Like