[Solved] Apache Alias and Slim 4

Hello,
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
       </Directory>

.htaccess :

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

Thank you in advance for your ideas or solutions.

Hello.
The same problem has been discussed at the following thread.
https://discourse.slimframework.com/t/slim-4-httpnotfoundexception/3273

Hello,
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
ex:
Add after $app->setBasePath("/youralias"); After AppFactory::create();

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

source:

@Quentin
Thanks! This is great information.