Htaccess redirect not working

Hi, Locally, I have slim installed in http://localhost/slim/public and can access a hello world in this directory.
However, I would like to serve content from http://localhost/slim/ and for this, I created a .htaccess file in the /slim directory with the following…

RewriteEngine on
RewriteRule ^$ slim/public/ [L]
RewriteRule (.*) slim/public/$1 [L]

However, Apache gives me an internal server error page when trying http://localhost/slim

I also have this in my index.php

$app = AppFactory::create();

The other requirements have been met in accordance to

What do I need to get things working from http://localhost/slim/



Did you also create the 2nd .htaccess file according to the documentation?
Please just copy the two .htaccess exactly as they are documented. You don’t need to change it.

Then set the Slim basePath to /slim and try it again.

1 Like

Thanks, that worked.

1 Like