Obviously it would depend on the circumstances of the country. Some countries simply have more available territory than others. But they could negotiate with their neighbors for help.
Say the international law mandates a certain area for a safe zone based on the size of the country's population and estimates of how many refugees they might have. Just as an example (not realistic) say that France finds it difficult to find an area in their own country that meets the requirements. They could negotiate with their immediate neighbors. Say Germany has more territory available. They could say, "Okay, France, in the event of a civil war we'll set aside X territory for refugees from your country, so you can meet the mandate."
That way, even if the refugees do end up having to flee their own country, they won't have to flee too far, and they'll be going into neighboring countries (where they're more likely to be a bit more culturally compatible, and they can more easily return once the civil war is over.)
Something like this seems superior to our current choices, which are basically "Fuck the refugees, let them suffer" or "Let them migrate unchecked into your own countries no matter how shitty that makes things for the natives."