Would it -- should it? -- matter if this 404 was generated because the server couldn't find a file or because a script couldn't find a route?

EDIT: A couple other examples.

Under the hood, it's possible that this is being rewritten to, but that shouldn't matter. What matters is whether the resource identified by the URL is available. If not, then a 404 Not Found is absolutely the correct response.