We all pray towards the Qibla in one direction, the smallest route towards the Kaaba. However, if you pray salah in the opppsite direction, aren't you still facing the Qiblah? Your facing a longer route towards the Kaaba but nevertheless you are still facing the Qiblah, in both direction. Can you pray like that or not?
If you pray to the exact opposite direction of al-Qibah, your prayer is not valid. It is a matter of orientation, not a matter of a prescribed route to the Ka'bah.
The verse in Qur'an 2:144 says:
قَدْ نَرَىٰ تَقَلُّبَ وَجْهِكَ فِي السَّمَاءِ ۖ فَلَنُوَلِّيَنَّكَ قِبْلَةً تَرْضَاهَا ۚ فَوَلِّ وَجْهَكَ شَطْرَ الْمَسْجِدِ الْحَرَامِ ۚ وَحَيْثُ مَا كُنتُمْ فَوَلُّوا وُجُوهَكُمْ شَطْرَهُ ۗ وَإِنَّ الَّذِينَ أُوتُوا الْكِتَابَ لَيَعْلَمُونَ أَنَّهُ الْحَقُّ مِن رَّبِّهِمْ ۗ وَمَا اللَّهُ بِغَافِلٍ عَمَّا يَعْمَلُونَ
We have certainly seen the turning of your face, [O Muhammad], toward the heaven, and We will surely turn you to a qiblah with which you will be pleased. So turn your face toward al-Masjid al-Haram. And wherever you [believers] are, turn your faces toward it [in prayer]. Indeed, those who have been given the Scripture well know that it is the truth from their Lord. And Allah is not unaware of what they do.
The root of the world qiblah (Arabic: قبله) is qa-ba-la (Arabic: قبل). This, according to Al-Ma'āni al-Jāmi', means:
- What is above the surface of the Earth, e.g., mountain or hill or otherwise, facing the person
- Everything as first seen.
Allah ﷻ used the word walli (Arabic: ول), of which its root is wa-la (Arabic: ولى), when referring to what a person faces. This, according to Al-Ma'āni al-Jāmi', means to get close to or near:
So one needs to face with one's front the direction of the Ka'bah through the shortest (nearest) path. The only exception may be the antipode of the Ka'bah (a point in French Polynesia in the South Pacific Ocean, slightly northeast of Tematangi).
When facing or turning one's back to a specific direction is required or mandated, the ruling explicitly stipulates both directions. For instance, in the case of urinating or defecating, one needs to neither face nor turn one's back to al-Qiblah:
وَحَدَّثَنَا أَحْمَدُ بْنُ الْحَسَنِ بْنِ خِرَاشٍ، حَدَّثَنَا عُمَرُ بْنُ عَبْدِ الْوَهَّابِ، حَدَّثَنَا يَزِيدُ، - يَعْنِي ابْنَ زُرَيْعٍ - حَدَّثَنَا رَوْحٌ، عَنْ سُهَيْلٍ، عَنِ الْقَعْقَاعِ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم قَالَ: إِذَا جَلَسَ أَحَدُكُمْ عَلَى حَاجَتِهِ فَلاَ يَسْتَقْبِلِ الْقِبْلَةَ وَلاَ يَسْتَدْبِرْهَا.
Abu Huraira said: When anyone amongst you squats for answering the call of nature, he should neither turn his face towards the Qibla nor turn his back towards it.