Wa `alaykum as-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
2- If someone has a specific medical condition that necessitates wearing underwear, then it would be considered as permissible in lieu of necessity but he has to offer fidyah (expiation).
In his response to your question, Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
It is not permissible for males to wear any sewn clothes and therefore it would be a breach of the rules of ihram to wear underwear. However, if someone has a specific medical condition that necessitates wearing underwear, then it would be considered as permissible in lieu of necessity but he has to offer fidyah.
If it is simply due to his concern of exposing one’s awrah, it is possible to guard against this possibility by wearing belts or pins to keep the two pieces of ihram as tight and firm as possible so that they do not come off easily.
If, however, someone wears sewn clothes such as underwear without any genuine excuse, then he has violated the conditions of ihram. He must, therefore, offer compensation by offering a sacrifice, feeding six persons, or fasting three days).
Allah Almighty knows best.
Editor’s note: This fatwa is from Ask the Scholar’s archive and was originally published at an earlier date.
Source: Excerpted, with slight modifications, from www.muslims.ca