All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Prostration for something other than prayer is permissible if there is a reason for it, such as prostration for recitation or thanking. Shaykh Al-Islaam Ibn Taymiyyah said: “If one seeks to make supplication and places his face in the dirt and prostates to supplicate Allaah The Almighty, then this prostration will be for supplication and nothing prevents this at all.”
However, some scholars deemed prostration with no reason as Makrooh (i.e. disliked), while others forbade it.
Shaykh Al-Islaam Ibn Taymiyyah also said: “What is disliked is to prostrate for no reason.”
Ibn Hajar Al-Haythami said: “It is prohibited to seek nearness to Allaah The Almighty through a prostration that has no reason, even if after prayer.”
Imaam Muslim reported in As-Saheeh from Rabee‘ah ibn Ka‘b Al-Aslami who said, “I would spend the night with the Messenger of Allaah, sallallaahu ‘alayhi wa sallam and would bring him water for his ablution and other things he needed. He, sallallaahu ‘alayhi wa sallam, once said to me: ‘Ask of me.’ I said, ‘I ask for your company in the Paradise.’ He, sallallaahu ‘alayhi wa sallam, said: ‘Is this the only thing you ask for?’ I said, ‘It is only this.’ He, sallallaahu ‘alayhi wa sallam, said: ‘Help me in this yourself by making prostration abundantly.'” [Muslim]
Al-‘Iraaqi said, as is stated in Faydh Al-Qadeer by Al-Minaawi : “This does not refer to the prostration that is separate from prayer such as that of recitation and thanking, for they are prescribed for a reason. However, what is meant is the prostration of prayer.”Allaah Knows best.