The sages taught in the Mishnah (108b): One who divorces a woman and remarries her, she is permitted to the yabam, and we do not say that since at the time she was divorced she stood before him under the prohibition of a brother's divorcee which is punishable by karet, how could she be permitted now? For since at the time of the zika she was permitted to him, we are not concerned with what preceded it, as the primary factor is the time of falling for yibum. Similarly, one who divorces an orphan and remarries her—meaning he married a minor orphan through rabbinic marriage, divorced her, and remarried her—she is permitted to the yabam, for just as her marriage is rabbinic, so too her get is rabbinic (and this requires great study, as I wrote in siman 141, section 9, and it must be said that it is not exact). However, a minor whose father married her off, which is a Torah marriage, and she was divorced during her minority through her father, whereby the get is also from the Torah, and he remarried her afterwards, which is a rabbinic marriage—for once she was married her father no longer has authority over her, and this is what is called an "orphan during the lifetime of the father"—and he died while she was still a minor, or even if she reached majority but he did not have relations with her after she reached majority, she is forbidden to the yabam. For according to the Torah, she is his brother's divorcee and he is liable for karet on her account. According to the Rambam, she is also exempt from chalitzah, but the Tur wrote that she performs chalitzah. It is possible that his reason is that not everyone knows the distinction and they might say that a yevamah goes out to the market without anything. It is better that the rival wife performs chalitzah and she too will be exempt, for if this one performs chalitzah, she would not exempt the rival wife with her chalitzah (Beit Shmuel, subsection 22), as there is no substance to her chalitzah, as has been explained.
שנו חכמים במשנה (ק"ח:) המגרש את האשה והחזירה מותרת ליבם ולא אמרינן הרי בשעה שנתגרשה עמדה עליו באיסור גרושת אחיו שהיא בכרת ואיך תותר עתה דכיון שבעת הזיקה היה מותר בה לא חיישינן להקודם דהעיקר הוא בשעת נפילה ליבום וכן המגרש את היתומה והחזירה כלומר שנשא יתומה קטנה בנשואין דרבנן וגירשה והחזירה מותרת ליבם דכשם שנשואיה דרבנן כמו כן גיטה מדרבנן (וצע"ג כמ"ש בסי' קמ"א סעיף ט' וצ"ל דלאו דווקא) אבל קטנה שהשיאה אביה דהם קדושי תורה ונתגרשה בקטנותה ע"י אביה שהגט הוא ג"כ מן התורה והחזירה אח"כ דהם נשואין דרבנן דמשנשאת אין לאביה רשות בה וזו היא שנקראת יתומה בחיי האב ומת בעודה קטנה או אפילו נתגדלה ולא בא עליה משגדלה ה"ז אסורה ליבם דמן התורה היא גרושת אחיו וחייב עליה כרת ולהרמב"ם פטורה גם מחליצה אבל הטור כתב שחולצת ואפשר שטעמו דלאו כ"ע ידעי ההפרש ויאמרו שיבמה יוצאה לשוק בלא כלום וטוב שתחלוץ הצרה ותפטר גם היא דאם היא תחלוץ לא תפטרה הצרה בחליצתה (ב"ש סקכ"ב) דאין עיקר לחליצתה כמ"ש: