Situation in which it is permissible to face a direction other than the Qibla Sunan an-Nasa'i 744
Arabic hadith text
أَخْبَرَنَا عِيسَى بْنُ حَمَّادٍ، قَالَ حَدَّثَنَا ابْنُ وَهْبٍ، قَالَ أَخْبَرَنِي يُونُسُ، عَنِ ابْنِ شِهَابٍ، عَنْ سَالِمٍ، عَنْ عَبْدِ اللَّهِ، قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلميُصَلِّي عَلَى الرَّاحِلَةِ قِبَلَ أَىِّ وَجْهٍ تَوَجَّهُ بِهِ وَيُوتِرُ عَلَيْهَا غَيْرَ أَنَّهُ لاَ يُصَلِّي عَلَيْهَا الْمَكْتُوبَةَ .
Translation
It was narrated that Abdullah said
"The messenger of Allah (peace be upon him) used to pray atop his mount while traveling, facing whatever direction it was facing, and he would pray witr atop it, but he did not pray the prescribed prayers atop it ".