[Solved] Apache Alias and Slim 4

I would like to launch a new project with Slim 4.
But when I want to create an alias with a RewriteBase in the .htaccess as I did in Slim 3, I get an error “NOT FOUND”, the subject has already been treated in another post. However the solution provided (RewriteBase does not work for me.)
Here is an example of configuration on a test machine:
VirtualHost :

ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/
        Alias "/api" "/var/www/html/wbs/slim4/public"
        <Directory "/api">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all

.htaccess :

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

Thank you in advance for your ideas or solutions.

The same problem has been discussed at the following thread.

Thank you for your link. I had seen this topic, but the solution was not at the top.
By dint of research I found the solution. You have to “just” use the function $ app-> setBasePath
And inform the path in the rewriteurl
Add after $app->setBasePath("/youralias"); After AppFactory::create();

on the .htaccess verifiy this line :
RewriteRule ^ /youralias/index.php [QSA,L]


Thanks! This is great information.