Noob, 404 ERROR when not including index.php

I am just getting started and have run into a issue. I followed the tutorial located at . I fire up the php dev server like this:

php -S

I go to this URL: and the web page shows Hello, bob … so far so good. Now I move the same index.php file to ~/src/public/app/api/v1/

now I go to and I get 404: File not found.

So I made a info.php file with <?php phpinfo(); ?> in it and go to … it WORKS !

At this point I try to go to and it WORKS ! Keep in mind I am running the php dev server so an .htaccess file won’t help. Why does the rewrite work with / but not /app/api/v1/ ? and how can I fix it ?

You may want to read

Specifically, php -S will only look for a default index.php in the directory where it was started unless you use the -t option in which case it will look in that directory for a default index.php.

Slim is intended to be used in such a way that index.php is in public and you create a new route for /app/api/v1/.