I’m using the PHP built-in server for a small, personal project.
I’m just wondering if there’s any way to rewrite all requests to just one script, which can then use $_SERVER['REQUEST_URI'] and similar in order to process different things.
Or, alternatively, is there any way to set a 404 ErrorDocument for the PHP server?
Yes, when you start the built in server you can specify a router script (instead of an Apache .htaccess file, as an example).
The docs