Visiting Medine and praying in Hz. Peygamber's Mosque is highly sunnet and is one of the most virtuous acts a Muslim can perform. However, it is essential to understand that visiting Medine is not part of the Hac rites — it is a separate, independent act of worship. A haci may visit Medine before Hac, after Hac, or even at a completely different time. Both timings are equally valid and there is no scholarly preference for one over the other.
Sheikh Ibn Baz stated that the purpose of visiting Medine is to pray in Hz. Peygamber's Mosque, where one namaz equals one thousand namazs in other camis (except Mescid-i Haram). The haci should also send salam upon Hz. Peygamber and his two companions, pray in the Rawdah if possible, and visit Baqi cemetery and the graves of the Uhud martyrs. He emphasized that the trip to Medine is for the sake of praying in the cami, not 'visiting the grave' as a hac ibadeti destination — this is an important theological distinction.
Sheikh Ibn Uthaymeen confirmed that there is no connection between Hac and visiting Medine in terms of Islamic law. Some hacilar mistakenly believe that visiting Medine is part of Hac or that their Hac is incomplete without it. This is incorrect. Hac is complete with its own rites performed in Mekke, Arafat, Muzdelife, and Mina. Visiting Medine is a separate recommendation that can be done at any time. He advised hacilar to plan their Medine visit based on practical considerations — flight routes, hotel availability, and group schedule — rather than believing one timing is religiously superior.