With file name throwing error: HttpNotFoundException / 404 But working with file name

i am working wamp my local machine url is

i have just currently installed default available
versions of slim framework 4.XX

It works : : I get response “hello world”

It does not work : :
Type: Slim\Exception\HttpNotFoundException /404

It does not work : :
Shows Apache error of 404

i have following : require DIR . ‘/vendor/autoload.php’;
i have set base path in the index.php = $app->setBasePath("/slim");

I also tried few things in

but could not work it out

will appreciate help on this.

Hi @amitjain

It does not work :
It does not work :

This is ok and should not work, because it’s not a valid and defined route for slim.


This is also good.

Please read this section about Slim 4 and Apache URL rewriting

You could also try this setup: https://github.com/selective-php/basepath#installation