The first: he is not obliged to fulfil it. This is the view of Abū Hanīfah and one of al-Shāfi‘ī’s two opinions, because no act of this kind is obligatory under Islamic law.
The second: he is obliged to fulfil it. This is the position of Mālik, Ahmad ibn Hanbal, and al-Shāfi‘ī in his other opinion, because this is an act of obedience to Allah. It is established in Sahīh al-Bukhārī that the Prophet—may Allah bless him and grant him peace—said:
“Whoever vows to obey Allah, let him obey Him; and whoever vows to disobey Allah, let him not disobey Him.”
If someone vows to travel to places other than mosques, or to travel solely to the grave of a prophet or righteous person, he is not obliged to fulfil his vow, by their agreement, for the Prophet—may Allah bless him and grant him peace—did not command such travel. Rather, he said:
“No journey should be undertaken except to three mosques: al-Masjid al-Harām, this mosque of mine, and al-Masjid al-Aqsā.”
Only an act of obedience becomes binding through a vow. Mālik and others explicitly stated that if someone vows to travel to the Prophet’s city, intending to pray in the mosque of the Messenger of Allah—may Allah bless him and grant him peace—he should fulfil his vow. But if his intention is solely to visit the grave without praying in the mosque, he should not fulfil his vow, because the Prophet—may Allah bless him and grant him peace—said:
“Mounts should not be driven on a journey except to three mosques.”
The judge Ismā‘īl ibn Ishāq discussed this issue in al-Mabsūt, and its substance appears in al-Mudawwanah, al-Khilāf, and other works by Mālik’s followers. He states that whoever vows to visit the Prophet’s mosque—may Allah bless him and grant him peace—is obliged to fulfil his vow, because the mosque is only visited