כְּמַעֲשֵׂ֧ה אֶֽרֶץ־מִצְרַ֛יִם אֲשֶׁ֥ר יְשַׁבְתֶּם־בָּ֖הּ לֹ֣א תַעֲשׂ֑וּ וּכְמַעֲשֵׂ֣ה אֶֽרֶץ־כְּנַ֡עַן אֲשֶׁ֣ר אֲנִי֩ מֵבִ֨יא אֶתְכֶ֥ם שָׁ֙מָּה֙ לֹ֣א תַעֲשׂ֔וּ וּבְחֻקֹּתֵיהֶ֖ם לֹ֥א תֵלֵֽכוּ׃
Nach dem Brauche des Landes Ägypten, darin ihr gewohnt habt, tuet nicht; auch nach dem Brauche des Landes Kanaan, wohin ich euch bringe, tuet nicht, nach ihren Satzungen wandelt nicht.
Shulchan Arukh, Yoreh De'ah
1. Not To Dress Like A Non-Jew, 3 Seifim: One [i.e., a Jew] should not follow the customs of non-Jews (nor should one try to resemble them) (Tur in the name of the Rambam). One should not wear clothing that is particular to them [i.e., their culture]; one should not grow forelocks on one’s head like the forelocks on their heads; one should not shave the sides [of one’s head] and grow one’s hair in the middle of one’s head [like they do]; one should not shave the hair in front of one’s face from ear to ear and let one’s hair grow [in the back] [like they do]; one should not build places [i.e., buildings]—like the non-Jews’ temples—so that large groups of people will enter them, like [non-Jews] do. RAMA: Rather, one [i.e., a Jew] should be distinct from them [i.e., non-Jews] in one’s manner of dress and in all of one’s actions. But all of this [i.e., these restrictions] apply only to things that non-Jews do for the sake of licentiousness. For example, they are accustomed to wearing red clothing, which is official/princely clothing, and other clothing that is similarly immodest. [These restrictions also apply] to things that they are accustomed to doing because of a custom or rule that does not have a[ny underlying] reason, out of concern that [a Jew who does such things will follow the] “ways of the Amorites,” and that it has the blemish of [i.e., is tainted by] idol worship inherited from their ancestors. But things that they are accustomed to doing for a useful purpose—such as their custom for expert doctors to wear particular clothing so that the doctors will be recognized as specialists—one is permitted to wear [such clothing]. (Maharik Shoresh 88) Similarly, things that are done out of respect or another reason, it is permitted [for one to do such things]. And therefore they said one may burn [the items of deceased] kings, and there is not in this “the ways of the Amorites.” (R"an, Chapter of the Laws of Non-Jews)