[Machine] That when the Messenger of Allah ﷺ migrated to Medina and most of its people were Jews, Allah commanded him to face the direction of the Kaaba for prayer. The Jews rejoiced and the Messenger of Allah ﷺ faced the direction of Jerusalem for around sixteen months. However, the Messenger of Allah ﷺ loved the direction of Ibrahim, ﷺ , so he would supplicate to Allah and look towards the sky. So Allah revealed to him, "We see the turning of your face to the heaven. So, We shall surely turn you to a Qiblah (prayer direction) that shall please you, so turn your face in the direction of Al-Masjid Al-Haram (Kaaba in Mecca)." (Quran 2:144) It means facing towards it. The Jews became uncertain and said, "What has turned them from their Qiblah (prayer direction) which they used to face?" (Quran 2:142) So Allah revealed, "And to Allah belongs the east and the west, so wherever you face (in prayer), there is the Face of Allah (guidance)." (Quran 2:115) "And We did not make the Qiblah (prayer direction) which you used to face except that We might make evident who would follow the Messenger from who would turn back on his heels." (Quran 2:143) Ibn Abbas said, "And to distinguish clearly between those who are truly certain and those who harbor doubts and suspicions, and Allah said, 'And there is none of you except he shall come to it (the Qiblah) by the will of Allah.' (Quran 2:143) It means it will be turned towards the people who have doubts and suspicions, 'Except the humble among you.' (Quran 2:45) It means those who believe in what Allah revealed." Ash-Shafi'i, may Allah have mercy on him, said regarding the verse, "So, turn your face in the direction of Al-Masjid Al-Haram (Kaaba in Mecca)." (Quran 2:144) It means, "And Allah knows best, so turn your face towards the direction towards which Allah directed you."
أَنَّ رَسُولَ اللهِ ﷺ لَمَّا هَاجَرَ إِلَى الْمَدِينَةِ وَكَانَ أَكْثَرُ أَهْلِهَا الْيَهُودَ أَمَرَهُ اللهُ أَنْ يَسْتَقْبِلَ بَيْتَ الْمَقْدِسِ فَفَرِحَتِ الْيَهُودُ فَاسْتَقْبَلَهَا رَسُولُ اللهِ ﷺ بَضْعَةَ عَشَرَ شَهْرًا وَكَانَ رَسُولُ اللهِ ﷺ يُحِبُّ قِبْلَةَ إِبْرَاهِيمَ عَلَيْهِ السَّلَامُ فَكَانَ يَدْعُو اللهَ وَيَنْظُرُ إِلَى السَّمَاءِ فَأَنْزَلَ اللهُ ﷻ {قَدْ نَرَى تَقَلُّبَ وَجْهِكَ فِي السَّمَاءِ} [البقرة 144] إِلَى قَوْلِهِ {فَوَلُّوا وُجُوهَكُمْ شَطْرَهُ} [البقرة 144] يَعْنِي نَحْوَهُ فَارْتَابَ مِنْ ذَلِكَ الْيَهُودُ وَقَالُوا {مَا وَلَّاهُمْ عَنْ قِبْلَتِهِمُ الَّتِي كَانُوا عَلَيْهَا} [البقرة 142] فَأَنْزَلَ اللهُ تَعَالَى {وَلِلَّهِ الْمَشْرِقُ وَالْمَغْرِبُ فَأَيْنَمَا تُوَلُّوا فَثَمَّ وَجْهُ اللهِ} [البقرة 115] {وَمَا جَعَلْنَا الْقِبْلَةَ الَّتِي كُنْتَ عَلَيْهَا إِلَّا لِنَعْلَمَ مَنْ يَتَّبِعُ الرَّسُولَ مِمَّنْ يَنْقَلِبُ عَلَى عَقِبَيْهِ} [البقرة 143] قَالَ ابْنُ عَبَّاسٍ وَلِيَمِيزَ أَهْلَ الْيَقِينِ مِنْ أَهْلِ الشَّكِّ وَالرِّيبَةِ قَالَ اللهُ ﷻ {وَإِنْ كَانَتْ لَكَبِيرَةً إِلَّا عَلَى الَّذِينَ هَدَى اللهُ} [البقرة 143] يَعْنِي تَحْوِيلَهَا عَلَى أَهْلِ الشَّكِّ {إِلَّا عَلَى الْخَاشِعِينَ} [البقرة 45] يَعْنِي الْمُصَدِّقِينَ بِمَا أَنْزَلَ اللهُ تَعَالَى قَالَ الشَّافِعِيُّ رَحِمَهُ اللهُ فِي قَوْلِهِ {فَثَمَّ وَجْهُ اللهِ} [البقرة 115] يَعْنِي وَاللهُ أَعْلَمُ فَثَمَّ الْوَجْهُ الَّذِي وَجَّهَكُمُ اللهُ إِلَيْهِ