The Messenger of Allah ﷺ said, "When one of you goes to relieve himself, he must not face the qiblah. Rather, let him face east or west."The narrator said, "When we came to Sham, we found that the latrines had been built facing the qiblah, so we would turn away from it and ask Allah's forgiveness."
حدثنا محمد بن جعفر قال أملى علي معمر بن راشد أخبرنا الزهري عن عطاء بن يزيد
قال رسول الله ﷺ إذا أتى أحدكم الغائط فلا يستقبلن القبلة ولكن ليشرق أو ليغرب قال فلما قدمنا الشام وجدنا مراحيض جعلت نحو القبلة فننحرف ونستغفر الله