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