cannot be used as a basis for analogy, we reply: Whatever departs from the original rule for an intelligible reason may be used as a basis for analogy; for the general principle of this Sharīʿah is that it does not differentiate between comparable cases, nor does it treat dissimilar cases alike. Once we know that the Lawgiver permitted prayer in whatever direction one’s camel was facing in order to encourage people to offer many voluntary prayers and not deprive them of them, we say: the same applies to the person walking. Many travelling people do not have a mount, and so you find them walking alongside the riders on foot from their homeland until they return to it. This is a well-known matter, familiar to people of earlier times when they travelled by camel.
But what should he face? The sunnah makes clear that his qiblah is the direction in which he is travelling. Thus, he must be facing either the qiblah or his direction of travel. If he turns the camel from its direction of travel toward the qiblah, his prayer is valid, because that is the original rule. But if he turns it away from its direction of travel toward a direction other than the qiblah, the scholars have said that this is not permissible (1), because he has departed both from facing the qiblah and from facing his direction of travel—the direction which the Lawgiver permitted to serve as his qiblah in order to facilitate his journey. If he turns it away from his direction of travel, his prayer becomes invalid.
However, if the animal causes him to turn away, some scholars have said that if the interval is prolonged, his prayer is invalid; but if it is not prolonged, his prayer remains valid (2).
The correct view is that if he is unable to turn it back, his prayer is not invalid at all, even if the interval is prolonged, because he falls under the ruling of one incapable of facing the qiblah.