over a mat, then places a kerchief on top of it, refusing to step either on the mat or on the carpet—indeed, when he does walk on them he does so with quick, bird-like taps! How well Ibn Masʿūd’s words apply to such people: “Either you are better guided than the Companions of Muhammad, or you are clinging to a branch of misguidance.” (End of quotation, abridged.)
Know that the Prophet’s order to pray in sheepfolds in these ḥadiths signifies mere permission, not obligation. Al-ʿIrāqī said:
“By unanimous agreement it is permissibility only. The Messenger of Allah ﷺ mentioned it so that no one would assume its ruling to be the same as that of camels, or he did so in direct response to a questioner who asked about both situations, forbidding prayer in the resting places of camels and permitting it in sheepfolds. As for the encouragement found in the wording, ‘for they are a source of blessing,’ it was given merely to distance sheepfolds from the ruling on camels, just as he described camel-owners as harsh and hard-hearted and sheep-owners as tranquil and gentle.” Al-Shawkānī cited this.
We therefore deem prayer permissible in all other locations previously mentioned where no authentic prohibition exists—such as the middle of a road, on the roof of the Kaʿbah, in the bottom of a valley, and the like—because of the general statement of the Prophet ﷺ: “Wherever a man is overtaken by the time of prayer, let him pray there.” This is a universal text that must be followed in every place, except those specifically excluded, as noted earlier. Success comes from Allah, exalted be He.
Third: Offering a voluntary prayer inside the Kaʿbah. When the Prophet ﷺ entered Mecca on the Day of Conquest, he prayed two rakʿahs inside the Kaʿbah, between the two pillars, with three cubits between him and the qiblah.