when the messenger of allaah (sallallaahu 'alaihi wa sallam) stood for prayer, he would face the ka'bah in both obligatory and voluntary prayers1, and he (sallallaahu 'alaihi wa sallam) ordered that, saying to the "one who prayed badly"2 : when you stand for prayer, perform ablution prefectly, then face the qiblah and say takbeer.3
"during a journey, he (sallallaahu 'alaihi wa sallam) would pray voluntary prayers and witr on his mount, wherever it faced carrying him [east or west]."4
the saying of allaah, the exalted, "wherever you turn, there is the face of allaah" (baqarah, 2:115) applies to this.5
"[sometimes] when he intended to pray non-obligatory prayers on his she-camel, he would make it face the qiblah, say takbeer, and pray towards wherever his mount turned its face."6
"he would make rukoo' and sajdah on his mount by lowering his head, making the sajdah lower than the rukoo'."7
"when he intended to pray obligatory prayers, he would dismount and face the qiblah."8
in prayer during severe fear, he (sallallaahu 'alaihi wa sallam) set the example for his ummah to pray "on foot, standing on their feet, or mounted; facing the qiblah or not facing it"9, and he also said, when they (the armies) meet, then it (i.e. the prayer) is takbeer and indication with the head.10
he (sallallaahu 'alaihi wa sallam) also used to say: what is between the east and the west is qiblah.11
jaabir (radiallaahu 'anhu) said:
"once, when we were with the messenger of allaah (sallallaahu 'alaihi wa sallam) on an expedition, the sky was cloudy, so we tried to find the qibla but we differed, so each one of us prayed in a different direction, and each of us drew marks in front of him in order to mark our positions. in the morning, we looked at it and found that we had not prayed towards the qiblah. so we mentioned this to the prophet (sallallaahu 'alaihi wa sallam) [but he did not order us to repeat (the prayer)] and he said: your prayer was sufficient."12
"he (sallallaahu 'alaihi wa sallam) used to pray towards bait al-muqaddas [with the ka'bah in front of him] before the following verse was revealed: "we see the turning of your faces to the heavens; now shall we turn you to a qiblah that shall please you: turn then your faces in the direction of the sacred mosque" (baqarah 2:144). when it was revealed he faced the ka'bah. there were people at qubaa' praying fajr when someone came to them and said, 'verily the messenger of allaah (sallallaahu 'alaihi wa sallam) has had some of the qur'aan revealed to him last night and he has been ordered to face the ka'bah, [verily] so face it'. their faces were towards shaam, so they turned round [and their imaam turned round to face the qiblah along with them]."13
1 this is a mutawaatir fact, so detail is not necessaary, although some of the evidence for it will follow.
2 see appendix 3.
3 collected by bukhaari, muslim & siraaj.
4 collected by bukhaari, muslim & siraaj. its takhreej is given in irwaa' al-ghaleel (289 & 588)
5 muslim; tirmidhi declared it saheeh.
6 abu daawood, ibn hibbaan in thiqaat (1/12), diyaa' in mukhtaarah with a hasan sanad,; ibn as-sukn declared it saheeh, as did ibn al-mulaqqin in khulasah badr al-muneer (22/1) and, before them, `abdul haqq al-ishbeeli in his ahkaam (no. 1394 with my checking). ahmad used it as proof, as ibn haani reported from him in his masaa'il (1/67).
7 ahmad & tirmidhi , who declared it saheeh.
8 bukhaari & ahmad.
9 bukhaari & muslim.
10 baihaqi with a sanad meeting the requirements of bukhaari and muslim.
11 tirmidhi and haakim, who declared it saheeh, and i have given it in irwaa' al-ghaleel (292), the publication of which allaah has made easy.
12 daaraqutni, haakim, baihaqi, tirmidhi, ibn maajah & tabaraani; it is given in irwaa' (296)
13 bukhaari, muslim, ahmad, siraaj, tabaraani (3/108/2) & ibn sa`d (1/234). it is also in irwaa' (290)