Israel ordered to reroute barrier