(Imām Bukhārī narrates): Yahya bin Bukair narrated the hadith to us, he said: Laith narrated the hadith to us, from Uqail, from Ibn Shihab, from Abdullah bin Amir bin Rabi'ah, that Hazrat Amir bin Rabi'ah (Allāh be pleased with him) informed him that
I saw the Messenger of Allāh ﷺ offering prayer upon his mount by the gesture of his head, whichever way the mount was facing, and the Prophet ﷺ did not do this in the obligatory prayer.
حَدَّثَنَا يَحْيَى بْنُ بُكَيْرٍ، قَالَ حَدَّثَنَا اللَّيْثُ، عَنْ عُقَيْلٍ، عَنِ ابْنِ شِهَابٍ، عَنْ عَبْدِ اللَّهِ بْنِ عَامِرِ بْنِ رَبِيعَةَ، أَنَّ عَامِرَ بْنَ رَبِيعَةَ أَخْبرَهُ، قَالَ
رَأَيْتُ رَسُولَ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ وَهُوَ عَلَى الرَّاحِلَةِ يسَبِّحُ، يُومِئُ بِرَأْسِهِ قِبَلَ أَيِّ وَجْه توَجه، وَلَمْ يَكُنْ رَسُولُ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ يَصْنَعُ ذَلِكَ فِي الصَّلاَة المَكْتُوبَةِ
Reference: Sahih Al Bukhari 1097