He was first commanded to face the Rock of the Temple in Jerusalem, then he was subsequently commanded to face the Kaʿbah. The religion, however, remained one and the same even though the law itself changed. In this very sense, the Exalted says:
“So judge between them by what Allah has revealed, and do not follow their whims, turning away from the truth that has come to you. To every one of you We have appointed a law and a clear way.”
(Qur’an, al-Mā’idah 5:48)
Whatever statute, pathway, or rite Allah allotted to each Scripture does not negate the unity of the religion. Thus, those who held fast to the Torah and the Gospel before they were abrogated or altered were upon the religion of Islam, even though they had a legal code peculiar to them. Likewise, those who adhered to the Gospel before it was distorted were on the religion of Islam, although the Messiah abrogated some of what was in the Torah and made lawful part of what had been forbidden to them. In the same way, Muḥammad—may Allah bless him and grant him peace—was sent with the religion of Islam, even though Allah later abrogated certain matters such as the direction of prayer. Whoever does not follow Muḥammad is not a Muslim but an unbeliever, and clinging to anything that contradicts his command, once his call has reached a person, will not benefit that person, for it will never be accepted from him.
For this reason, when Allah—Most High—revealed:
“Whoever seeks a religion other than Islam, it will never be accepted from him.”
(Qur’an, Āl ʿImrān 3:85)
the Jews and Christians said, “We are Muslims.” Allah then declared:
“Pilgrimage to the House is a duty owed to Allah by all people who are able to find a way to it.”
(Qur’an, Āl ʿImrān 3:97)
They replied, “We do not make the pilgrimage,” so He said:
“But whoever disbelieves—Allah has no need of the worlds.”
(Qur’an, Āl ʿImrān 3:97)
Al-Tirmidhī and others have reported from the Prophet—peace and blessings be upon him—