Di Maria, who has been heavily linked with a move to both Manchester United and Paris St Germain, has rejected the offer of a new contract with the current European champions.
Khedira, who has also turned down new terms at the Bernabeu, has been a reported target for Arsenal this summer and Arsene Wenger admitted on Thursday that he was still hoping to strengthen his squad before the transfer window closes.
Ancelotti said. "Di Maria asked to go in the summer and has rejected an offer from the club, The player has to look for a solution.
"If when the transfer market closes he's still here, he will work with us like last season and there will be no problem.”
PSG manager Laurent Blanc admitted that UEFA fair play rules could scupper any further interest from his club.
"With large players like Di Maria, there are a lot of clubs behind him certainly," Blanc told L'Equipe.
"PSG can not do what he wants in terms of recruitment (because of financial fair play). This is a difficult issue, the president has confirmed to me."
Ancelotti said of Khedira: "It's a different situation to Di Maria. He's not asked to go. He's rejected an offer to renew, but has a year of contract. We'll see what happens."
Madrid signed two more attacking midfielders in James Rodriguez and Toni Kroos this summer to increase the pressure for places in their star-studded squad.
Di Maria came off the bench in the Super Cup first leg against Atletico Madrid on Tuesday night, but Khedira did not feature.
Watch the second leg of the Spanish Super Cup between Real Madrid and Atletico on Friday August 22 on Sky Sports 5 from 21.30