Shaykh Maulana Abdul Aziz Alvi
Hadith Commentary: Benefits and Issues: (1)
The mosque has a special association with Allah Ta'ala, due to which it is called Baytullah (the House of Allah). Therefore, its rights, the etiquette of entering it, and its reverence and honor require that a person should perform two units (rak‘ahs) before sitting in it. This is, in a sense, a greeting to the Divine Court, which is why it is called Tahiyyat al-Masjid. According to the majority of the scholars, since this act is due to the etiquette and reverence of the mosque, it is considered a recommended (mustahabb) act. However, according to the Zahiri school, it is obligatory (fard). It should be clear that after entering the mosque, if one performs an obligatory (fard), Sunnah, or voluntary (nafl) prayer, the right of Tahiyyat al-Masjid is fulfilled, because the objective is the reverence and honor of the mosque, which has been achieved.
(2)
There is a difference of opinion regarding performing prayers with a specific cause (sababi) during the prohibited times (awqat al-nahy). Imam Abu Hanifah, Imam Malik rahimahullah, and according to one opinion, Imam Ahmad rahimahullah, do not consider any prayer—whether sababi or non-sababi—permissible during the prohibited times. However, Imam Shafi‘i rahimahullah, and according to one opinion which Hafiz Ibn Taymiyyah rahimahullah has adopted, Imam Ahmad rahimahullah consider sababi prayers permissible during the prohibited times, because: (إِذَا دَخَلَ أَحَدُكُمْ الْمَسْجِدَ) (“When one of you enters the mosque...”) is general, and the prohibition pertains to absolute prayers, i.e., those without a specific cause. Therefore, it is permissible to repeat the Fajr and ‘Asr prayers with the imam, to perform the funeral prayer after ‘Asr, and to perform the circumambulation (tawaf) units of prayer. This proves that performing sababi prayers during the prohibited times is correct, but one should not create a cause without necessity.
(3)
Among the etiquettes and rights of entering the mosque is that a person should enter in a state of ablution (wudu), so that he can perform Tahiyyat al-Masjid before sitting. If one forgets and sits before performing Tahiyyat al-Masjid, he should stand up and perform it.
(4)
When the sun is rising, at its zenith (zawal), or setting, then one should wait for the completion of the rising, setting, or zenith, because there is a specific prohibition regarding these times.
(5)
The Tahiyyat of Masjid al-Haram is tawaf (circumambulation). If, for some reason, this is not possible, then at the very least, one should perform two units (rak‘ahs) of prayer.
Source: Tuhfat al-Muslim: Commentary on Sahih Muslim, Page: 1655