Fix path detection if request url contains location url