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:2243Abū ʿAbdullāh al-Ḥāfiẓ from my father

[Machine] The Messenger of Allah ﷺ sent a group, in which I was present, on a mission. Darkness fell upon us and we couldn't determine the direction of the qibla (direction of prayer). Some of the companions said that the qibla is towards the north, so pray and draw a line. Others said that the qibla is towards the south, so they prayed and drew a line. However, when morning came and the sun rose, those lines were not aligned with the qibla. We returned from our journey and went to the Prophet ﷺ and asked him about it. He remained silent and then Allah revealed the verse "To Allah belongs the east and the west. So wherever you turn, there is the face of Allah" (Surah Al-Baqarah, 2:115), which means wherever you are, that is the qibla.  

البيهقي:٢٢٤٣أَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ ثنا أَبُو الْحُسَيْنِ عَلِيُّ بْنُ الْحُسَيْنِ الرُّصَافِيُّ بِبَغْدَادَ ثنا مُحَمَّدُ بْنُ الْحَارِثِ الْعَسْكَرِيُّ حَدَّثَنِي أَحْمَدُ بْنُ عُبَيْدِ اللهِ بْنِ الْحَسَنِ الْعَنْبَرِيُّ قَالَ وَجَدْتُ فِي كِتَابِ أَبِي ثنا عَبْدُ الْمَلِكِ بْنُ أَبِي سُلَيْمَانَ الْعَرْزَمِيُّ عَنْ عَطَاءِ بْنِ أَبِي رَبَاحٍ عَنْ جَابِرِ بْنِ عَبْدِ اللهِ ؓ قَالَ

بَعَثَ رَسُولُ اللهِ ﷺ سَرِيَّةً كُنْتُ فِيهَا فَأَصَابَتْنَا ظُلْمَةٌ فَلَمْ نَعْرِفِ الْقِبْلَةَ فَقَالَتْ طَائِفَةٌ مِنْهَا الْقِبْلَةُ هَاهُنَا قِبَلَ الشِّمَالِ فَصَلُّوا وَخَطُّوا خَطًّا وَقَالَ بَعْضُهُمُ الْقِبْلَةُ هَاهُنَا قِبَلَ الْجَنُوبِ وَخَطُّوا خَطًّا فَلَمَّا أَصْبَحْنَا وَطَلَعَتِ الشَّمْسُ أَصْبَحَتْ تِلْكَ الْخُطُوطُ لِغَيْرِ الْقِبْلَةِ فَقَدِمْنَا مِنْ سَفَرِنَا فَأَتَيْنَا النَّبِيَّ ﷺ فَسَأَلْنَاهُ عَنْ ذَلِكَ فَسَكَتَ وَأَنْزَلَ اللهُ ﷻ {وَلِلَّهِ الْمَشْرِقُ وَالْمَغْرِبُ فَأَيْنَمَا تُوَلُّوا فَثَمَّ وَجْهُ اللهِ} [البقرة 115] أَيْ حَيْثُ كُنْتُمْ وَكَذَلِكَ  

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