There are TWO opinions from scholars with regards to this issue of whether a woman can travel without being accompanied by a mahram (husband or male relative whom she is prohibited to marry).
This opinion is held by scholars from the school of Imam Abu Hanifah and Imam Ahmad bin Hanbal. It is based on an absolute understanding of many narrations from the Prophet s.a.w.
Abu Hurairah r.a. reported: The Messenger of Allah ﷺ said,
"It is not permissible for a woman who believes in Allah and the last day to make a journey of one day and night unless she is accompanied by a mahram (husband or male relative whom she is prohibited to marry)."
[Al Bukhari and Muslim]
Ibn 'Abbas r.a. reported: The Prophet ﷺ said,
"No man must not be alone with a woman except in the presence of her mahram. No woman should travel except in the company of a mahram." A man said: "O Messenger of Allah! I have been enrolled for such and such expedition, and my wife left for Haj." He ﷺ said to him, "Go and perform Haj with your wife."
[Al Bukhari and Muslim]
This opinion is held by scholars from the school of Imam Shafi’i, Imam Malik and by most contemporary scholars: Sheikh Yusuf Al Qaradawi, The European Fatwa Council, Darul Ifta’ of Egypt, Shaykh Qara Daghi and scholars from Al Azhar.
Clearly, these scholars were aware of the existence of the above-mentioned authentic narrations from the Prophet ﷺ. However, they used the sciences of hadith to examine the narrations deeply including looking at the asbab al wurud (reasons why the hadith was said by the Prophet ﷺ ), isnad (chain of narration) and illah (the effective reason).
These scholars deduced that the illah (effective reason) why women were not allowed to travel without a mahram in the past was because of safety issues. If she can fulfil the conditions that allow her to travel safely, the prohibition is lifted.
To support this ruling, there is another narration based on Sahih Bukhari in Fathul Bari written by Ibnu Hajar: It has been narrated through 'Adiy Ibn Hatem r.a. that the Prophet ﷺ told him, "And if you live a long life, you will surely see women traveling from Hira till they tawaf the Ka'bah, fearing no one except Allah". Imam Ahmad's report of the hadith includes: "By He in whose hands is my soul, verily Allah will bring this matter [Islam] into completion until women travel from Hira and tawaf the Ka'bah without being accompanied by anyone." Scholars mentioned that this particular narration from the Prophet ﷺ is a form of glad tiding.
Therefore, according to the scholars who were inclined to this opinion, it is permissible for a woman to travel without a mahram if she observes the following:
1. She ensures that the paths towards her destination and on her return journey are safe and she does not meet with any harassment and chaos which can jeopardise safety.
2. She has trustworthy companions throughout the journey.
The majority of scholars, such as 'Ata’, Sa'id Ibn Jubair, Ibn Sirin and Hasan al Basri, have also permitted a woman to travel for obligatory Haj without a mahram if she is accompanied by trustworthy people. Imam Abu al Hasan Ibn Batal mentioned in Sharh Bukhari, "Imam Malik, Imam Al Awza'i and Imam Shafi'i said, 'A woman who does not have a mahram may travel for her obligatory Haj with other women in trustworthy company.’” These scholars based their opinion on a precedent - the Mothers of Believers r.a. performed Haj after the Prophet's death and during the caliphate of 'Umar r.a. while they were accompanied by 'Uthman ibn 'Affan r.a, who was clearly not a mahram. Furthermore, Ibn 'Umar accompanied women from among his neighbours for Haj.
In another opinion, Imam Al Baji, a Maliki scholar, mentioned in Al Muntaqa Sharh Al-Muwatta that a woman's travel without a mahram is contingent upon the number of people accompanying her. It is impermissible for her to travel without a mahram if she is with a small group of people. However, it is permissible for her to travel without a mahram if she is accompanied by a large number of people who can ensure her safety. This opinion was reported from Imam Al Awza'i.
The scholars differ on the issue but it is my personal opinion that it is better for a woman to be cautious and to put in all efforts to travel with trustworthy company who can look out for her safety, and that may include a maḥram. In Islam, women are given high status and are not considered the weaker sex. The principle behind the narrations from the Prophet ﷺ on travelling with a mahram is to honour, protect and give special care for women.
It is up to the individual to choose which opinion he or she is comfortable with, without dismissing the others. All the opinions mentioned came from scholars who are knowledgeable and worthy in giving their ijtihad. May Allah have mercy on them and may Allah guide us all.