Fix two issues:
1. Visiting http://localhost:3000/abc/def (this path does not exist) makes the path of javascript and css to "/abc/modules/xxx" and will not display 404 page
2. Do not remove the "removeRoot" string only if it is at the beginning of the path