וַיֹּ֨אמֶר מֹשֶׁ֣ה אֶל־הָעָם֮ אַל־תִּירָאוּ֒ הִֽתְיַצְב֗וּ וּרְאוּ֙ אֶת־יְשׁוּעַ֣ת יְהוָ֔ה אֲשֶׁר־יַעֲשֶׂ֥ה לָכֶ֖ם הַיּ֑וֹם כִּ֗י אֲשֶׁ֨ר רְאִיתֶ֤ם אֶת־מִצְרַ֙יִם֙ הַיּ֔וֹם לֹ֥א תֹסִ֛יפוּ לִרְאֹתָ֥ם ע֖וֹד עַד־עוֹלָֽם׃
Sinabi ni Moises sa bayan: “Huwag kayong matakot; tumayo kayong matatag at masdan ninyo ang pagliligtas ng Walang-Hanggan na gagawin niya para sa inyo ngayong araw; sapagkat ang mga taga-Egipto na nakita ninyo ngayong araw ay hindi na ninyo muling makikita kailanman.
Mishneh Torah, Kings and Wars
It is permissible to live anywhere in the world, except for Egypt, defined as the area extending west of the Mediterranean Sea, 400 Parsangs by 400 Parsangs, in the direction of Ethiopia and in the direction of the desert. The Torah warned us in three places not to return to Egypt, “and do not return in this way again” (Deut. 17:16), and “and you shall no longer see it” (Deut. 28:68), and “And you shall not ever again see it” (Exodus 14:13). Alexandria is included in this prohibition.
Sefer HaMitzvot
That we have been prohibited from dwelling in the Land of Egypt forever, so that we not learn from their practices and not follow their disgraceful ways. And that is His saying, "You must not return that way again" (Deuteronomy 17:16). And this prohibition was already repeated three times: They said in the Gemara (Yerushalmi Sukkah 4:1 ), "In three places did the Holy One, blessed be He, warn Israel not to return to Egypt; and at three times did they return and get punished from them." Indeed one of the three places is that which we mentioned. The second is, "by a route which I told you, you should not see again" (Deuteronomy 28:68). And the third is, "for Egypt which you have seen this day - you will never again see them" (Exodus 14:13). Even though it appears from the words that it is narrative, the tradition comes [to teach that] it is a prohibition. And it has already been explained in the Gemara, Sukkah (Sukkah 51b), that Alexandria is from the cities in which it is forbidden to dwell. And [from the Sea of] Alexandria, the measurement of the perimeter of Egypt is four hundred parasangs by four hundred parasangs - and that is the total of the Land of Egypt in which it is forbidden to dwell. But it is permissible to travel in it for business, or to pass through to a different land. And in explanation, they said in the Yerushalmi (Yerushalmi Sanhedrin, Chapter 10 at the end), "You may not return for living, but you may return for business and to conquer the land." (See Parashat Shoftim; Mishneh Torah, Kings and Wars 5.)
Sefer HaChinukh
To not ever dwell in the Land of Egypt: That we not further go back on the way to Egypt ever; meaning to say that we do not establish our residence in Egypt. And about this is it stated (Deuteronomy 17:16), “and the Lord said to you, ‘You shall not further go back on this way again.’” And the prevention of this is repeated three times: They, may their memory be blessed, said (Mekhilta DeRabbi Yishmael 14:13:2), “In three places did the Torah warn not to return to the Land of Egypt [...] In the three they returned, and in the three they were punished.” And these three places [are] the one we mentioned; the second is “by the way that I said to you, ‘You shall not further again, etc.’” (Deuteronomy 28:68); and the third is “as that which you see Egypt today, you shall not further, etc.” (Exodus 14:13) — and even though it appears to be [only] a story from its revealed meaning, the tradition comes about it that it is a prevention (a negative commandment).