كتاب صلاة المسافرين وقصرها
6  
The Book of Prayer - Travellers
(4)
Chapter: It is permissible to offer voluntary prayers atop one’s mount when travelling, no matter what direction it is facing
(4)
باب جَوَازِ صَلاَةِ النَّافِلَةِ عَلَى الدَّابَّةِ فِي السَّفَرِ حَيْثُ تَوَجَّهَتْ ‏‏
Sahih Muslim 700 g

'Abdullah b. Dinar reported on the authority of Ibn 'Umar that the Messenger of Allah (ﷺ) used to observe prayer on his ride (no matter) in which direction it had its face turned. 'Abdullah b. Dinar said that Ibn 'Umar used to do like that.

وَحَدَّثَنَا يَحْيَى بْنُ يَحْيَى، قَالَ قَرَأْتُ عَلَى مَالِكٍ عَنْ عَبْدِ اللَّهِ بْنِ دِينَارٍ، عَنِ ابْنِ عُمَرَ، أَنَّهُ قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يُصَلِّي عَلَى رَاحِلَتِهِ حَيْثُمَا تَوَجَّهَتْ بِهِ ‏.‏ قَالَ عَبْدُ اللَّهِ بْنُ دِينَارٍ كَانَ ابْنُ عُمَرَ يَفْعَلُ ذَلِكَ ‏.‏
Reference : Sahih Muslim 700g
In-book reference : Book 6, Hadith 47
USC-MSA web (English) reference : Book 4, Hadith 1503
  (deprecated numbering scheme)