Actually, that’s how modern PHP apps are meant to work. That’s how php_fastcgi works by default. Read here:
What I recommend is doing the routing in your PHP app. You can make changes to your index.php file. Check the original request URI in $_SERVER['REQUEST_URI'] and do what you need from there.
I strongly recommend serving that from a subdomain instead.