var index = path.indexOf("?");
        if(index>0) {
            path = path.substr(0,index);
        }

remove querystring.