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.
bayhaqi:5246Abū Saʿīd b. Abū ʿAmr > Abū al-ʿAbbās Muḥammad b. Yaʿqūb > al-Rabīʿ > al-Shāfiʿī

[Machine] Imam Shafi'i said that women used to pray with Aisha, the wife of the Prophet ﷺ, in her room. Aisha told them not to pray with the prayer of the imam because they were behind him in the veil. Imam Shafi'i, may Allah have mercy on him, said, "And as Aisha said in her room, if she said it, we said it." Sheikh also narrated from Ali ibn Abi Talib that he said, "There is no prayer for the neighbor of the mosque except in the mosque." This was also narrated from Abu Huraira from the Prophet ﷺ, elevated.  

البيهقي:٥٢٤٦أَخْبَرَنَا أَبُو سَعِيدِ بْنُ أَبِي عَمْرٍو ثنا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ أنبأ الرَّبِيعُ قَالَ

قَالَ الشَّافِعِيُّ قَدْ صَلَّى نِسْوَةٌ مَعَ عَائِشَةَ زَوْجِ النَّبِيِّ ﷺ فِي حُجْرَتِهَا فَقَالَتْ لَا تُصَلِّيَنَّ بِصَلَاةِ الْإِمَامِ؛ فَإِنَّكُنَّ دُونَهُ فِي حِجَابٍ قَالَ الشَّافِعِيُّ رَحِمَهُ اللهُ تَعَالَى وَكَمَا قَالَتْ عَائِشَةُ فِي حُجْرَتِهَا إِنْ كَانَتْ قَالَتْهُ قُلْنَاهُ قَالَ الشيخ وَرُوِّينَا عَنْ عَلِيِّ بْنِ أَبِي طَالِبٍ ؓ أَنَّهُ قَالَ لَا صَلَاةَ لِجَارِ الْمَسْجِدِ إِلَّا فِي الْمَسْجِدِ وَرُوِيَ ذَلِكَ عَنْ أَبِي هُرَيْرَةَ عَنِ النَّبِيِّ ﷺ مَرْفُوعًا