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:2232al-Faqīh Abū Bakr Muḥammad b. Bakr al-Ṭūsī > Abū Bishr Muḥammad b. Aḥmad al-Ḥāḍirī > Abū al-Ḥasan Muḥammad b. Aḥmad b. Zuhayr > ʿAbdullāh b. Hāshim > Yaḥyá b. Saʿīd > ʿUbaydullāh > Nāfiʿ > Ibn ʿUmar > ʿUmar > Mā Bayn al-Mashriq And al-Maghrib Qiblah Wakadhalik Rawāh Ghayruhumā > Nāfiʿ Waruwy > Abū Hurayrah Marfūʿ Waruwy > Yaḥyá b. Abū Kathīr > Abū Qilābah

[Machine] About the Prophet ﷺ , it is narrated from Ali and Ibn Abbas from their saying, and the intended meaning, Allah knows best, is the people of Madinah and whoever had their qiblah (direction of prayer) towards the people of Madinah, in the area between the East and the West, would seek their qiblah and then look towards it.  

البيهقي:٢٢٣٢أَخْبَرَنَا الْفَقِيهُ أَبُو بَكْرٍ مُحَمَّدُ بْنُ بَكْرٍ الطُّوسِيُّ ثنا أَبُو بِشْرٍ مُحَمَّدُ بْنُ أَحْمَدَ الْحَاضِرِيُّ ثنا أَبُو الْحَسَنِ مُحَمَّدُ بْنُ أَحْمَدَ بْنِ زُهَيْرٍ ثنا عَبْدُ اللهِ بْنُ هَاشِمٍ ثنا يَحْيَى بْنُ سَعِيدٍ ثنا عُبَيْدُ اللهِ أَخْبَرَنِي نَافِعٌ عَنِ ابْنِ عُمَرَ عَنْ عُمَرَ قَالَ مَا بَيْنَ الْمَشْرِقِ وَالْمَغْرِبِ قِبْلَةٌ وَكَذَلِكَ رَوَاهُ غَيْرُهُمَا عَنْ نَافِعٍ وَرُوِيَ عَنْ أَبِي هُرَيْرَةَ مَرْفُوعًا وَرُوِيَ عَنْ يَحْيَى بْنِ أَبِي كَثِيرٍ عَنْ أَبِي قِلَابَةَ

عَنِ النَّبِيِّ ﷺ مُرْسَلًا وَرُوِيَ عَنْ عَلِيٍّ وَابْنِ عَبَّاسٍ مِنْ قَوْلِهِمَا وَالْمُرَادُ بِهِ وَاللهُ أَعْلَمُ أَهْلَ الْمَدِينَةِ وَمَنْ كَانَ قِبْلَتُهُ عَلَى سَمْتِ أَهْلِ الْمَدِينَةِ فِيمَا بَيْنَ الْمَشْرِقِ وَالْمَغْرِبِ يَطْلُبُ قِبْلَتَهُمْ ثُمَّ يَطْلُبُ عَيْنَهَا