[Fix][#33829] Use 404 response codes when server URL rewriting is enabled. Fixes #3739