—the same ruling applies to these as well.¹ An obligatory prayer is not valid inside the Kaʿbah, within its semi-circular annex (al-Ḥijr), or on its roof—unless no part of the Kaʿbah remains behind the worshiper. A vowed prayer, however, is valid both inside it and on top of it, and the same holds for voluntary prayers; indeed, offering a supererogatory prayer within the Kaʿbah is recommended.
Eighth: facing the qiblah whenever one is able. If he cannot find anyone who can indicate the direction with certainty, he should determine it by his own judgment; should he be mistaken, he need not repeat the prayer.²
Ninth: intention (niyyah), which is never dispensed with under any circumstance. Its locus is the heart, and its reality is the resolve to perform the act. Its prerequisites are Islam, sanity, and discernment. The time for it is at the very start of the act of worship, or a brief moment before, and it is preferable to link it to the opening takbīr.
Along with the intention to pray, one must specify which prayer he is performing—Zuhr, ʿAṣr, Friday, Witr, or a regular sunnah; if he does not, a generic intention to pray suffices.³ It is not necessary to state whether the prayer is current, a make-up, or obligatory. It is, however, a condition⁴ that the imam intend to lead and⁵ the follower intend to be led.