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.
quran:2:142

The foolish among the people will say, "What has turned them away from their qiblah, which they used to face?" Say, "To Allah belongs the east and the west. He guides whom He wills to a straight path."  

The fools, the ignorant, among the people, that is, the Jews and the idolaters, will say, ‘What, matter, has turned them, the Prophet (s) and the believers, from the direction they were facing in their prayers formerly?’, this being the Holy House (bayt al-maqdis, sc. Jerusalem); the sīn ˹of sa-yaqūlu, ‘they will say’˺ denotes the future tense and informs of the Unseen. Say: ‘To God belong the East and the West, that is, all directions. Thus He commands that they face whichever direction He wills, and there can be no objection. He guides whomever He will, His guidance being, to a straight path’, that is, the religion of Islam, and you are among these ˹guided ones˺.
القرآن:٢:١٤٢

سَيَقُولُ السُّفَهَاءُ مِنَ النَّاسِ مَا وَلَّاهُمْ عَنْ قِبْلَتِهِمُ الَّتِي كَانُوا عَلَيْهَا ۚ قُلْ لِلَّهِ الْمَشْرِقُ وَالْمَغْرِبُ ۚ يَهْدِي مَنْ يَشَاءُ إِلَىٰ صِرَاطٍ مُسْتَقِيمٍ  

{سيقول السفهاء} الجهال {من الناس} اليهود والمشركين {ما ولاّهم} أي شيء، صرف النبي والمؤمنين {عن قبلتهم التي كانوا عليها} على استقبالها في الصلاة وهي بيت المقدس، والإتيان بالسين الدالة على الاستقبال من الإخبار بالغيب {قل لله المشرق والمغرب} أي الجهات كلها فيأمر بالتوجه إلى أي جهة شاء لا اعتراض عليه {يهدي من يشاء} هدايته {إلى صراط} طريق {مستقيم} دين الإسلام أي ومنهم أنتم دل على هذا.