حَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ، عَنْ عَبْدِ الرَّزَّاقِ، عَنْ مَعْمَرٍ، عَنِ الزُّهْرِيِّ، عَنْ عَطَاءِ بْنِ يَزِيدَ اللَّيْثِيِّ، عَنْ أَبِي أَيُّوبَ الْأَنْصَارِيِّ، قَالَ: قَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ: «إِذَا أَتَى أَحَدُكُمُ الْغَائِطَ فَلَا يَسْتَقْبِلِ الْقِبْلَةَ وَلَا يَسْتَدْبِرْهَا، وَلَكِنْ لِيُشَرِّقْ أَوْ لِيُغَرِّبْ»
It is narrated from Sayyiduna Abu Ayyub al-Ansari (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When one of you goes to relieve himself, let him not face the qiblah nor turn his back to it, but let him face east or west."