fix URL creation if webapp is not deployed in root context