Visiting the Prophet's Mosque is recommended at any time of the year, whether before Hajj or after it. The Prophet, , said: “Do not set out on a journey [for worshipping purposes] except to three Mosques: My Mosque, the Sacred Mosque [in Makkah], and Al-Aqsa Mosque [in Jerusalem].”[Muslim] This is because the Prophet's Mosque is a place of great merit where the rewards for acts of worship are multiplied. It was narrated on the authority of Abu Hurayrah, may Allah be pleased with him, that the Prophet, , said: “One prayer in my Mosque is better than one thousand prayers in any other Mosque, except in the Sacred Mosque [i.e. Al-Masjid Al-Haraam in Makkah].”[Al-Bukhari and Muslim] It should be noted that visiting the Mosque of the Prophet, , is not a requirement for Hajj to be valid, as some Muslims mistakenly believe.
When a Muslim travels intending to visit the Prophet's Mosque, he should invoke blessings and peace on the Prophet, , on his way. He should feel the virtue of Madeenah and that it is the best place on earth second only to Makkah – according to some scholars - or the best of all according to other scholars. When he arrives at the door of the Prophet's Mosque, the visitor should enter with his right foot and say: “Bismillaah was-salaatu was-salaamu ‘ala rasoolillaah, a‘oothu billaahi al-‘Atheem wa bi-wajhihi al-kareem wa sultaanihi al-qadeem min ash-shaytaan ar-rajeem, Allahumma iftah li abwaaba rahmatik (In the Name of Allah, and peace and blessings be upon the Messenger of Allah. I seek refuge with Allah, The Almighty, and with His Honorable Face, and with His Eternal Sovereignty from the accursed Satan. O Allah, open the gates of your Mercy for me.)” This supplication is also to be said upon entering any other Masjid (Mosque).
He should then perform two Rak‘ahs (units of prayer) as Tahiyyatul-Masjid (the mosque salutation prayer), preferably in Ar-Rawdhah Ash-Shareefah (a select part of the Mosque), without harming others. Ar-Rawdhah is located between the pulpit of the Prophet, , and his room. The Prophet, , said: “Between my house and my pulpit is one of the gardens of Paradise; and my pulpit overlooks my Hawdh [Basin].” [Al-Bukhari and Muslim] In this area, a Muslim can supplicate to Allah to grant him whatever he likes of the goodness of this life and the Hereafter. The visitor and every other Muslim should try his best to perform the obligatory prayer in the first rows.
After the prayer, one should visit the grave of the Prophet, , and the graves of Abu Bakr and ‘Umar, may Allah be pleased with them. He should stand facing the noble grave, feeling in his heart the grandeur and sublime status of the one whom he is visiting. Then, he should extend his greetings of Salaam (peace), saying, “Assalaamu ‘alayka ya rasoolallaah warahmatullaahi wabarakaatuh. (Peace, blessings and the mercy of Allah be upon you, O Messenger of Allah.)” After that, he should send prayers on the Prophet, , with any reported formula. He, for instance, can say, “Allahumma salli ‘ala Muhammad, wa‘ala aali Muhammad, kama sallayta ‘ala Ibraaheem wa ‘ala aali Ibraaheem, innaka Hameedum Majeed. Allahumma baarik ‘ala Muhammad, wa‘ala aali Muhammad, kama baarakta ‘ala Ibraaheem wa ‘ala aali Ibraaheem, innaka Hameedum Majeed [O Allah, confer prayers on Muhammad and the family of Muhammad just as You conferred prayers on Ibraaheem (Abraham) and the family of Ibraaheem. You are Praised and Glorious. O Allah, bless Muhammad and the family of Muhammad just as You blessed Ibaaheem and the family of Ibraaheem. You are Praised and Glorious.)” There would be no harm if he adds to this: “I testify that you have delivered the Message, advised the Ummah [Muslim nation], and strove in the cause of Allah as was due to Him.” This is because all these are apt descriptions of the Prophet, . He should then move a little to his right and extend his Salaam to Abu Bakr, may Allah be pleased with him, saying, “Peace be upon you, O Abu Bakr, the chosen friend of the Messenger of Allah and his companion in the Cave. May Allah reward you with the best on behalf of the Ummah of the Messenger of Allah .” Then, he should move a little to his right and extend his Salaam to ‘Umar ibn Al-Khattaab, may Allah be pleased with him, and say, “Peace be upon you, O ‘Umar, with whom Allah made Islam victorious. May Allah reward you abundantly on behalf of the Ummah of His Prophet .”
The visitor should then supplicate for them and ask Allah to be pleased with them. When Ibn ‘Umar, may Allah be pleased with him, would extend his Salaams to the Prophet, , and his two Companions, he would only say, “Peace be upon you, O Messenger of Allah; peace by upon you, O Abu Bakr; and peace by upon you, O my father.” [Al-Bayhaqi] None of the formulas of Salaam we have mentioned is obligatory, and it is enough to extend Salaam to them with any formula.
It is disliked for the visitor to raise his voice too loud with Salaam before the grave, for this is against the politeness due to the Prophet, . Allah The Almighty Says (what means): {O you who have believed, do not raise your voices above the voice of the Prophet or be loud to him in speech like the loudness of some of you to others, lest your deeds become worthless while you perceive not.} [Quran 49-2]
It is not permissible for the visitor to face the grave during supplication because this is contrary to the practice of the righteous predecessors. Instead, he should face the Qiblah (prayer direction), praise Allah The Almighty, glorify Him and supplicate with what he likes for himself, his parents, relatives, Shaykhs, and all other Muslims. It is not permissible to ask the Prophet, , to fulfill one's needs or alleviate his/her troubles or anything that is to be sought only from Allah The Almighty.
The visitor should try his best to perform the obligatory five daily prayers in the Mosque of the Prophet, , and utilize his time in much Thikr (remembrance and mentioning of Allah), supplication and voluntary prayers. These acts command enormous reward. It is an act of Sunnah for the Muslim to visit Masjid Qubaa’ and perform prayers in it. The Prophet, , would visit it riding his mount, and on foot, and perform two Rak‘ahs in it. The Prophet, , said: “Whoever performs ablution in his home and comes to perform prayer in Masjid Qubaa’, he will earn the reward of an ‘Umrah [lesser pilgrimage]”. [Al-Bukhari and Muslim]
It is also recommended for him to visit the Baqee‘ cemetery and the graves of the martyrs of Uhud, since the Prophet, , used to visit them and supplicate for them. A Muslim should remember the Hereafter there and say the reported supplication, “As-salaamu ‘alaykum ahl-ad-diyaari min al-mu’mineena wal-muslimeen, wa inna inshaa’ Allahu bikum laahiqoon. Nas’alul-laaha lana wa-lakumul- ‘aafiyah (Peace be upon you, O inmates of the abodes, from among believers and Muslims, and when Allah wills, we shall follow you, we ask Allah for well-being for ourselves and for you.”