that is among the finest deeds, as it is established in the two Sahīh collections that the Prophet—may Allah bless him and grant him peace—said:
“Whoever purifies himself at home and then sets out for the mosque, one of his steps erases a sin and the other raises him a degree. A servant remains in prayer as long as he is waiting for prayer. The angels pray for each of you as long as he remains in the place where he prayed, saying, ‘O Allah, forgive him; O Allah, have mercy on him,’ so long as he does not break his state of ritual purity.”
If someone were to travel from one town to another—for example, from Egypt to Damascus for the sake of its mosque, or vice versa—or travel from a distant town to the Mosque of Qubā’, this would not be prescribed, by agreement of the four imams and others. If he vowed to do so, he should not fulfil his vow, by agreement of the four imams and others, apart from an isolated dissenting view reported from al-Layth ibn Sa‘d concerning mosques. Ibn Maslamah, one of Mālik’s followers, held this view specifically concerning the Mosque of Qubā’.
However, when someone comes to Medina, it is recommended that he visit the Mosque of Qubā’ and pray there, since this does not constitute travel or setting out on a journey. The Prophet—may Allah bless him and grant him peace—used to visit the Mosque of Qubā’ every Saturday, both riding and walking, and pray two rak‘ahs there. He said:
“Whoever purifies himself at home and then comes to the Mosque of Qubā’ will have a reward like that of an ‘umrah.”
This was narrated by al-Tirmidhī and Ibn Abī Shaybah. Sa‘d ibn Abī Waqqās and Ibn ‘Umar said: “A prayer there is like an ‘umrah.”
If someone vows to walk to Mecca for Hajj and ‘umrah, his vow is binding upon him by agreement of the Muslims. If he vows to go to the mosque in Medina or the mosque in Jerusalem, there are two opinions: