odan / slim4-skeleton

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

Using skeleton in a subdirectory #126

Closed x821938 closed 10 months ago

x821938 commented 10 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 10 months ago

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

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

Thanks a lot :) Now everything is working.