Muwatta Malik, Book 14, Hadith 1 (USC-MSA) ⓘ
Yahya related to me from Malik from Ishaq ibn Abdullah ibn Abi Talha that Rafiibn Ishaq, a mawla of the family of ash-Shifa who was known as the mawla of Abu Talha, heard Abu Ayyub al-Ansari, one of the companions of the Messenger of Allah, may Allah bless him and grant him peace, say, while he was in Egypt, "By Allah! I don't know how to deal with these lavatories." The Messenger of Allah, may Allah bless him and grant him peace, said, "When you go to defecate or urinate, do not expose your genitals towards the qibla, and do not put your back to it."
حَدَّثَنِي يَحْيَى، عَنْ مَالِكٍ، عَنْ إِسْحَاقَ بْنِ عَبْدِ اللَّهِ بْنِ أَبِي طَلْحَةَ، عَنْ رَافِعِ بْنِ إِسْحَاقَ، مَوْلًى لآلِ الشِّفَاءِ - وَكَانَ يُقَالُ لَهُ مَوْلَى أَبِي طَلْحَةَ - أَنَّهُ سَمِعَ أَبَا أَيُّوبَ الأَنْصَارِيَّ صَاحِبَ رَسُولِ اللَّهِ صلى الله عليه وسلم وَهُوَ بِمِصْرَ يَقُولُ وَاللَّهِ مَا أَدْرِي كَيْفَ أَصْنَعُ بِهَذِهِ الْكَرَايِيسِ وَقَدْ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " إِذَا ذَهَبَ أَحَدُكُمُ الْغَائِطَ أَوِ الْبَوْلَ فَلاَ يَسْتَقْبِلِ الْقِبْلَةَ وَلاَ يَسْتَدْبِرْهَا بِفَرْجِهِ " .
also referenced under: Book 14, Hadith 458 (In-Book)