The scholars are agreed that it is better for a worshipper’s forehead and hands to touch the ground directly when he prostrates, except when he has an excuse.
However, they differed as to whether that is obligatory or not. Imam al-Shafi`i was of the view that it is obligatory, but the majority of scholars are of the view that it is mustahabb only and not obligatory.
Nevertheless, a worshipper should not use his turban or hat as a protection between his forehead and the ground except in cases of need, such as when the ground is very hard, or there are stones that may hurt him, or thorns. In that case there is nothing wrong with protecting himself from the ground with something that is attached to him, such as his turban or clothing.
Anas bn Malik (may Allah be pleased with him) said: We used to pray with the Prophet (peace and blessings be upon him) when it was very hot, and if one of us could not put his forehead on the ground, he would spread out his garment and prostrate on it.
This indicates that it is better to let the forehead touch the place of prostration directly, but there is nothing wrong with a man protecting himself from the ground with something attached to him such as his garment or turban, if there is a need for that because the ground is very hot or very cold, or it is rough. But he should remember that it is also essential to allow the nose to touch the ground as well in this case, because of the hadith of Ibn `Abbas (may Allah be pleased with him) who narrated that the Prophet (peace and blessings be upon him) said: “I have been commanded to prostrate on seven bones: the forehead” – and he pointed to his nose –“ the hands, the knees and the ends of the feet” (Bukhari and Muslim)