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
Even if he is available, not sure he is needed. We already have more than enough number 10's, enough strikers and 2 talented left sided wingbacks now. Where will he fit in anyways? What we need right now, is a competent central defender and a good holding midfielder. I love Fletcher but he can't cut it as a defensive midfielder for United against any sort of decent opposition with the condition he has. Again a half decimated squad has gone on to start the league campaign, it is time people realize that the players we have in defence and midfield just aren't United quality. Everyone was quick to bash Moyes last season for every debacle, and though sometimes right, he was treated unfairly and it is time the players take the blame and offer the consistency which has been synonymous with United for close to two decades now. Woodward is the main culprit, totally out his depth with his ill advised comments and the way he is conducting the transfer dealings for us.- utd_till_i_die