in prayer between the Yemeni Corner and the Black Stone, so that the Ka‘bah was between him and Jerusalem. When he migrated to Madinah, he continued, by Allah’s command, to pray toward Jerusalem for sixteen months and part of the seventeenth; then, after that, he was commanded to turn toward the Ka‘bah. (1)
It is not valid without this, except for one who is unable to do so, and for a traveller riding and offering a voluntary prayer...
His statement, “It is not valid without this,” means that the prayer is not valid without facing the qiblah, due to the Prophet’s saying, “Whoever performs an action that is not in accordance with our command, it is rejected.” (2) Facing the qiblah is a condition, and the principle is that when a condition is absent, that which depends upon it is also absent. For this reason, the prayer is not valid without it.
His statement, “except for one who is unable,” means one who is unable to face the qiblah; in his case, the obligation of facing it is waived. The author has made two exceptions:
The first is the person who is unable: his prayer is valid without facing the qiblah. One example is a sick person who cannot move and has no one to turn him toward the qiblah. In that case, he prays facing whichever direction he is already facing, because he is unable to do otherwise.
The evidence for this is Allah’s saying: “So fear Allah as much as you are able.” [al-Taghabun: 16] And His saying: “Allah does not burden a soul beyond its capacity.” [al-Baqarah: