Non-Muslims are allowed to enter Madinah. The prohibition is restricted to Makkah and its Holy Sites only. Rather, the Prophet’s Mosque in Madinah is not liable to this prohibition. In this context, Imam Ash-Shafi`isaid, “There is no harm in permitting an unbeliever to spend the night in any mosque with the exception of the Holly Mosque in Makkah.” It is well-known that the Prophet (peace and blessings be upon him) used to welcome non-Muslim delegations in his mosque in Madinah.
It is forbidden for Muslims to allow any non-Muslim to enter Al-Masjid Al-Haram in Makkah and its sacred precinct, because Allah says: “O ye who believe! The idolaters only are unclean. So let them not come near Al-Masjid Al-Haram (at Makkah) after this their year. If ye fear poverty (from the loss of their merchandise) Allah shall preserve you of His bounty if He will. Lo! Allah is Knower, Wise.” (At-Tawbah: 28)
Yet, when Islam prohibits non-Muslims from entering the sanctuary of Makkah, it is not an invented tradition since Joshua, according to the Gospel, burnt the city of Jericho (Arihah) in Palestine and prohibited entering it.
The Old Testament, likewise, spoke about the cities of the refugees where the murderers could resort to in order to escape from people. Then, what is odd about declaring a sanctuary for Islam!
Based on the above Qur’anic verse, Imam Ash-Shafi`i is of the viewpoint that non-Muslims are not allowed to enter the Sacred Mosque only and not the whole land of Makkah.
According to our history, the Archangel Gabriel [Jibril] (peace and blessings be upon him) has taught Prophet Ibrahim (peace and blessings be upon him) the boundaries of the Haram (the Sanctuary of Islam in Makkah). Therefore, Prophet Muhammad (peace and blessings be upon him) commanded his Companions on the Day of `Arafah during the Farewell Pilgrimage, saying, “Stick to your rites for you are on a heritage of Ibrahim.”
Islam, accordingly, inherited the Haram (the Sacred Mosque) from Ibrahim (peace and blessings of Allah be upon him). Here, it is noteworthy that Muslims themselves have no absolute freedom in the Sacred Mosque. They, for example, are forbidden to hunt animals or to cut trees in the Haram. The Muslims’ ruler, rather, is not allowed to carry out penalties or retaliation in the land of the Haram. This is in accordance to the Qur’anic verse that announces, “… whoever enters it attains security.” (Al `Imran: 97)
There is no wonder then in making a sanctuary for the Ka`bah for it has been a well-known tradition throughout the history of all nations. The Ka`bah is the House of Allah, Most High, and He has the undeniable right to protect it against the disbelievers who associate other deities with Him. Nevertheless, when a disbeliever converts to Islam, he will be welcomed in the House of Allah and its sanctuary.
Thus, I would like to stress the fact that when Islam prohibits non-Muslims from entering its sanctuary, it brings no innovation since it is a well-known tradition in all religions and nations throughout history as we have previously pointed out. Islam, in fact, does not only forbid some individuals to enter its sanctuary but also prevents the intermingling of two or more contradictory systems and beliefs.
Let me further draw your attention to the peak of freedom in the opinion of Abu Hanifah, the eminent Muslim jurist and the founder of the Hanafi school of thought, who holds the opinion that non-Muslims may enter the Sacred Mosque in case of necessity and when there is no necessity as well.
Although Muslim jurists differ with Abu Hanifah regarding this issue, I want to show you to what extent Islam advocates freedom of opinion. However, I think that Abu Hanifah held the above opinion for he might interpret the above Qur’anic verse as referring to preventing non-Muslims from performing Hajj (pilgrimage).