Our teacher, the Beit Yosef, wrote in section 21: If he said to her, "on condition that you do not go to your father's house until such-and-after time," even though the get is valid and the condition is binding, no person should endeavor for a get to be given with such a condition, because it is impossible for her to restrain herself from going to her father's house, and the get will be found to be void and her children mamzerim. And if the one divorcing is among those whom we compel to divorce, and he did not want to divorce except with this condition, we compel him to divorce without this condition. Thus far his words. And it appears that the same applies if it is a mitzvah to divorce her, such as if she is licentious; even though we do not have the power to compel him, nevertheless, it is necessary to endeavor greatly that he should not give it upon such a condition. And it implies that regarding other conditions, such as "that you shall not eat meat" or "that you shall not drink wine," we are not concerned that she will transgress, and this is a wonder, for certainly one should be concerned about this as well; and perhaps his intention was indeed so, and he only cited it as a mere example. In any event, we have heard from his words that she is permitted to marry before the fulfillment of the condition, for if not so, what mamzerut is there in this? And as I wrote in section 75, see there. But if he said, "on condition that you do not go to your father's house forever," this is not "severance" (Gemara 21b), just as with "on condition that you do not drink wine forever." And even though when her father dies or sells the house to another it is no longer considered "her father's house," as we learned in Nedarim (46a): "Konam to your house that I enter," if he died or sold it to another, it is permitted—here, where he said "your father's house," it is different, for all his descendants are called "his father's house" even when he has died, as it is written regarding Tamar, "Remain a widow in your father's house," and her father had already died (Tosafot). And some say that in truth it deals with when he said "this house," which is forbidden forever as is stated in Nedarim there (Rashba, chapter 2). And even though in such a case if the house fell or was burned and they built another it is permitted, as is written in Yoreh Deah siman 216, nevertheless, it is not standing to fall or to be burned. And according to the Rambam it is settled without this, as will be explained with the help of Heaven (Ran). And regarding a sale, it must be said according to the first excuse that even when he sells it, perhaps he will buy it back from him (Mishneh LaMelech).
וכתב רבינו הב"י בסעיף כ"א אמר לה ע"מ שלא תלכי לבית אביך עד זמן פלוני אע"פ שהגט כשר והתנאי קיים אין לשום אדם להשתדל בגט שינתן בתנאי כזה כי א"א לעמוד על נפשה מלכת לבית אביה ונמצא גט בטל ובניה ממזרים ואם המגרש הוא מאותן שכופין להוציא ולא רצה לגרש אלא בתנאי זה כופין אותו לגרש בלא תנאי זה עכ"ל ונראה דה"ה אם מצוה לגרשה כגון שהיא פרוצה אע"פ שאין ביכולתינו לכופו מ"מ בהכרח להשתדל הרבה שלא יתן על תנאי כזה ומשמע דעל תנאים אחרים כמו שלא תאכלי בשר ולא תשתי יין אין אנו חוששין שתעבור והוא תימא דוודאי יש לחשוש בזה ג"כ ואולי ג"כ כוונתו כן ולא נקט רק לדוגמא בעלמא ועכ"פ שמענו מדבריו שרשאה להנשא קודם קיום התנאי דאל"כ איזו ממזרות יש בזה וכמ"ש בסעיף ע"ה ע"ש אבל אם אמר ע"מ שלא תלכי לבית אביך לעולם אין זה כריתות (גמ' כ"א:) כמו בע"מ שלא תשתי יין לעולם ואע"ג דכשמת אביה או מכר הבית לאחר לא חשיב עוד בית אביה כדתנן בנדרים (מ"ו.) קונם לביתך שאני נכנס מת או מכרו לאחר מותר הכא שאמר בית אביך שאני דכל יוצאי חלציו קרוים בית אביו אפילו כשמת כדכתיב גבי תמר שבי אלמנה בית אביך וכבר מת אביה (תוס') וי"א דבאמת מיירי כשאמר בית זה דלעולם אסור כדאיתא בנדרים שם (רשב"א פ"ב:) ואע"ג דבכה"ג אם נפלה הבית או נשרפה ובנו אחרת מותר כמ"ש ביו"ד סי' רט"ז מ"מ הא אינה עומדת לנפילה או לשריפה ולהרמב"ם א"ש בלא זה כמו שיתבאר בס"ד (ער"ן) ובמכירה צ"ל לתירוץ הראשון דאף כשימכור שמא יקנה ממנו בחזרה (מל"מ):