The manner of legal burials
It is established in Islamic law that burying the dead is by way of honoring them due to the words of Allah the Almighty when He enumerates His blessings,
Did we not make the earth a home for the living and the dead? [Al-Mursalat:25-26]
Islam encourages burial. There is a consensus among Muslims that burying the dead is a communal obligation which, if undertaken by some, its obligation is fulfilled and the sin and responsibility is lifted from the rest.
Manner of burial
It has been transmitted down to us that after entering the deceased into the grave, he is laid on his right side and his face is turned towards the qibla (direction of prayer). There is a consensus among the imams of the four schools of jurisprudence on this manner of burial and, based on this unanimity, it is unlawful to bury the deceased in any other manner such as by placing his legs towards the qibla — a common and erroneous [practice] followed in our times. Depending on the location of the grave's entrance, the deceased is to be entered from the opening of the grave to face the qibla without the need to turn him around in the grave. There is no harm if the floor of the grave is either sand or clay soil as it is permissible to bury in both.
The kind of grave required for burial in Islamic law
The deceased must be buried in a hole that protects his body from tampering and which conceals the body and its odor. The principle is that it must be either a shaqq or a lahd.
A shaqq is a pit that is dug in the floor of the grave. It must be equal to the height of an average man with his arm extended upwards i.e. 2.25 m. A hole is then dug in the bottom of this pit and it must be big enough to accommodate the full length of the body of the deceased positioned on its right side and facing the qibla as described above. Afterwards, raw bricks are placed under the head of the deceased and his hands are positioned at his sides. Finally, the shaqq is roofed over with blocks or stones, the digger exits the grave and earth is shoveled into it.
A lahd is hollow dug in one side of a deep grave. It must be raised from the floor of the grave two thirds of the full height of the digger and must be large enough to accommodate the body of the deceased in the manner described above. Finally, the open side of the lahd is sealed off with a wall of raw bricks or stones, the digger exits the grave and earth is shoveled inside it.
A shaqq or a lahd are only valid in firm ground. Otherwise, in places where the ground is soft such as in Egypt and some other places, there is no harm if a deceased is buried in another manner provided it meets the requirements of Islamic law. In Egypt where the ground is soft and abounds in underground water, the shaqq and lahd cannot be used for burial. For this reason, people in Egypt have for centuries resorted to burying their dead in vaults. There is no objection in Islamic law to this as maintained by latter Shafi'i scholars and others.
Allah the Almighty knows best.