Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
tabarani:3933Muḥammad b. Yazdād al-Tawzī al-Baṣrī > al-Walīd b. Shujāʿ > ʿAnbasah b. ʿAbd al-Wāḥid > Muḥammad b. Yaʿqūb > Isḥāq b. ʿAbdullāh Abū Ṭalḥah > Rāfiʿ b. Isḥāq a man from Qudamāʾ Ahl al-Madīnah > Abū Ayyūb al-Anṣārī

[Machine] He heard Abu Ayyub Al-Ansari say, "The Messenger of Allah ﷺ forbade us from facing or turning away from the Qiblah (direction of prayer) when one of us goes to urinate or defecate."  

الطبراني:٣٩٣٣حَدَّثَنَا مُحَمَّدُ بْنُ يَزْدَادَ التَّوْزِيُّ الْبَصْرِيُّ ثنا الْوَلِيدُ بْنُ شُجَاعٍ ثنا عَنْبَسَةُ بْنُ عَبْدِ الْوَاحِدِ عَنْ مُحَمَّدِ بْنِ يَعْقُوبَ عَنْ إِسْحَاقَ بْنِ عَبْدِ اللهِ أَبِي طَلْحَةَ عَنْ رَافِعِ بْنِ إِسْحَاقَ رَجُلٍ مِنْ قُدَمَاءِ أَهْلِ الْمَدِينَةِ

أَنَّهُ سَمِعَ أَبَا أَيُّوبَ الْأَنْصَارِيَّ يَقُولُ «نَهَانَا رَسُولُ اللهِ ﷺ أَنْ نَسْتَقْبِلَ الْقِبْلَةَ أَوْ نَسْتَدْبِرَهَا إِذَا ذَهَبَ أَحَدُنَا يَبُولُ أَوْ يَتَغَوَّطُ»  


See similar narrations below:

Collected by Ibn Mājah
ibnmajah:318Abū al-Ṭāhir Aḥmad b. ʿAmr b. al-Sarḥ > ʿAbdullāh b. Wahb > Yūnus > Ibn Shihāb > ʿAṭāʾ b. Yazīd > Abū Ayyūb al-Anṣārī

"The Messenger of Allah forbade the person who went to the Gha'it to face the Qiblah. He said: 'face towards the east or the west.'"  

ابن ماجة:٣١٨حَدَّثَنَا أَبُو الطَّاهِرِ أَحْمَدُ بْنُ عَمْرِو بْنِ السَّرْحِ أَنْبَأَنَا عَبْدُ اللَّهِ بْنُ وَهْبٍ أَخْبَرَنِي يُونُسُ عَنِ ابْنِ شِهَابٍ عَنْ عَطَاءِ بْنِ يَزِيدَ

أَنَّهُ سَمِعَ أَبَا أَيُّوبَ الأَنْصَارِيَّ يَقُولُ نَهَى رَسُولُ اللَّهِ ﷺ أَنْ يَسْتَقْبِلَ الَّذِي يَذْهَبُ إِلَى الْغَائِطِ الْقِبْلَةَ وَقَالَ شَرِّقُوا أَوْ غَرِّبُوا