I put up an RFC earlier for native handling of entrypoints and 404 handling inside of MediaWiki: https://www.mediawiki.org/wiki/Requests_for_comment/Entrypoint_Routing_and_4...
I've begun the initial code in a branch: https://github.com/dantman/mediawiki-core/compare/master...2012%2F404-routin...
I incorporated Extension:Special404's 404 special page for now and updated my PathRouter and WebRequest code I implemented awhile ago to differentiate between requests that are 404s and requests that should go to the main page. So it's already handling 404s.
Of course there are more things I plan to clean up, improve, and add to this handling.
But right now I encourage people to try pulling this change in and trying it out. Set your 404 error handler to index.php or rewrite any nonexistent file to index.php (remember you NEVER want a ?title=$1 in the /index.php for any rewrite or error handler)
I would love to see if anyone manages to break it and make it serve a 404 page when it should actually be sending you to the main page.