Fixes an issue with URLs that have a rootPath.