odan / slim4-skeleton

A Slim 4 Skeleton
https://odan.github.io/slim4-skeleton/
MIT License
439 stars 80 forks source link

Using skeleton in a subdirectory #126

Closed x821938 closed 8 months ago

x821938 commented 8 months ago

How would you adjust the .htaccess to make the skeleton work in a subdirectory? I am writing an API wich resides in /var/www/api It should be accessed by going to https://www.example.com/api

odan commented 8 months ago

In this case the Slim basePath must be set to /api.

$app->setBasePath('/api');
x821938 commented 8 months ago

Thanks a lot :) Now everything is working.