Have you checked the HTTP headers in the response?
I am wondering if the first is being detected by the container as a directory request and is being automatically redirected to the welcome file, rather than running through your '301' code.
The correct behaviour when a resource is not available is to return 404. Doing otherwise may have unforeseen consequences.