The crisis in Gaza is an extreme example of the general crisis in urban warfare. Explosives/cannons became the weapons of choice when wars were fought on battleFIELDS. We now have STREETbattles; but the military hasn't changed its methods -- at least not in any fundamental way.
I hope to write a piece about this soon, but let me just give a sense of what I am thinking, here.
The bottom line is that use of wide-area impact explosives in densely populated areas has to be strictly ruled. But that in itself will not be enough.
The approach to securing a city has to be a warfare/welfare combined operation. If you call on people to evacuate a part or the whole of a city, then it is your responsibility to offer them at the very least temporary shelter, a food supply, communications, etc. If a hospital needs to be evacuated the welfare preparations/delivery have to be even more comprehensive. (I note that Israel tried to offer incubators; nice, but a drop in the bucket.)
The communication dimension is equally important. It needs to be made crystal clear that the enemy is ONLY those who engage in combat. Referring to the current crisis; Palestines are not Israel's enemy; even Hamas as a whole is not Israel's enemy (many of them are just civil administrators); only the military wing of Hamas is "fair game." There should be strict discipline in place to counter indiscriminate harm to non-combatants, and the noncombatants should have a means of reporting abuse; and should see their unjust treatment punished.
If all this sounds "unrealistic", that's just an indicator of how far there is to go before urban warfare become something other than bashing a city and its inhabitants. The military conquest of a city by current methods practically guarantees widespread hatred of the conquerors. If the true objective is peace, better methods must be found.