The Ruling on One Who Prays by Best Judgement and Then Learns He Faced the Wrong Direction
Is the prayer valid for one who used his best judgement about the qibla and then found he had prayed away from it, and must he repeat it?
Whoever seeks out the direction of the qibla by his best judgement and prays, then learns of his error, his prayer is valid and no repetition is due, for he did what lay within his capacity.
Whoever uses his best judgement and prays, then learns of his error, his prayer suffices and no repetition is due once the time has passed; repeating it within the time is recommended.
Whoever prays by his best judgement and then becomes certain of the error must repeat the prayer, within its time and after it, because facing the qibla is a condition that has been shown not to have been met.
One who knows the indications of the qibla, uses his best judgement while travelling and prays, then learns of his error, his prayer is valid and no repetition is due, on the strength of His saying: ﴿فَأَيْنَمَا تُوَلُّوا فَثَمَّ وَجْهُ اللَّهِ﴾ (al-Baqarah 115) and the hadith of ʿĀmir ibn Rabīʿah. But if he prayed while resident and erred, he repeats it.