Hadithcore
Mishkat al-Masabih, 462

‘A'isha reported God’s messenger as saying, “Turn these houses so as not to face the mosque, for I do not make the mosque lawful for a menstruating woman or one who is seminally defiled.” Abu Dawud transmitted it.

وَعَنْ عَائِشَةَ قَالَتْ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «وَجِّهُوا هَذِهِ الْبُيُوتَ عَنِ الْمَسْجِدِ فَإِنِّي لَا أُحِلُّ الْمَسْجِدَ لِحَائِضٍ وَلَا جنب» . رَوَاهُ أَبُو دَاوُد

References1 variant
In-Book Reference
Book 3, Hadith 166