A woman who has given birth is permitted to wear shoes for all thirty days, because the cold is harmful to her. The same applies to a sick person even if there is no danger, and one who has a wound on his foot. The same applies to a pregnant woman when she fears the cold. Similarly, any person is permitted to wear shoes in a place where there is danger of a scorpion. Similarly, if the official calls for him, or if he is compelled to go before some lord – he may wear shoes. Some require placing ashes in the shoes, and it is proper. A mourner and an excommunicated person who were walking on the road are permitted to wear sandals, and when they reach the city, they remove them. There is one who says that if it is a city where the majority are gentiles – they do not remove them until they enter the Jewish street. Now that we dwell mixed together – he should not remove them until he reaches his courtyard. If one needs to remove shoes in the cemetery after the deceased is buried, it was explained in siman 375. Some say that one must walk barefoot from the cemetery to his home when his father or mother dies. Our teacher, the Rema, wrote that he did not see this practiced, and this is so that they should not mock us. But in a place where they are not – certainly one must do so (Shach, subsection 3). And it appears that for all deceased relatives one must walk barefoot from the cemetery if it is at all possible, such as when there is no fear of mockery, and the ground is dry. (See the Beit Yosef in the name of Hagahot Maimoniyot that they were accustomed to walk in "botas." And it appears that it is a type of shoe that is not of leather, like our "guma" shoes. The Beit Yosef wrote that he did not know the reason for this, see there. And it appears that there is no reason for this other than that they feared the cold.)
החיה מותרת לנעול כל שלושים יום, מפני שהצינה קשה לה. והוא הדין חולה אף שאין בו סכנה, ומי שיש לו מכה ברגלו. והוא הדין מעוברת כשחוששת לצינה. וכן כל אדם מותר לנעול במקום שיש סכנת עקרב. וכן אם השר קורא לו, או שמוכרח לילך לפני איזה אדון – יכול לנעול. ויש מצריכין להשים אפר בהמנעלים, ונכון הוא. ואבל ומרוחק שהיו מהלכים בדרך – מותרים בנעילת הסנדל, וכשיגיעו לעיר חולצין. ויש מי שאומר שאם היא עיר שרובה כותים – אין חולצין עד שיכנסו לרחוב היהודים. ועכשיו שדרין מעורבין – לא יחלוץ עד שיגיע לחצרו. ואם צריך לחלוץ מנעל בבית הקברות אחר שנקבר המת, נתבאר בסימן שע"ה. ויש אומרים שצריך לילך יחף מבית הקברות לביתו כשמת אביו או אמו. וכתב רבינו הרמ"א שלא ראה נוהגין כן, וזהו מפני שלא ילעגו עלינו. אבל במקום שאינם – בוודאי צריך לעשות כן (ש"ך סעיף קטן ג). ונראה דעל כל המתים צריך לילך יחף מבית הקברות אם רק אפשר, כמו כשליכא חשש לעג, והארץ יבשה. (עיין בית יוסף בשם הגהות מיימוניות שהיו נוהגים לילך בבוטא"ש. ונראה שהוא מין מנעל שאינו של עור, כמו מנעלי גומ"א שלנו. וכתב הבית יוסף שלא ידע טעם לזה, עיין שם. ונראה דאין בזה טעם אלא שחששו לצינה.)