יפוצו
Yafutzu

Mishneh Torah — Tefillin, Mezuzah, Torah Scroll הִלְכוֹת תְּפִלִּין וּמְזוּזָה וְסֵפֶר תּוֹרָה, Chapter 6

The full Hebrew text of Mishneh Torah, Tefillin, Mezuzah, Torah Scroll, Chapter 6, with English translation by Maimonides (Rambam).

עֲשָׂרָה תְּנָאִין יֵשׁ בַּבַּיִת וְאַחַר כָּךְ יִתְחַיֵּב הַדָּר בּוֹ לַעֲשׂוֹת לוֹ מְזוּזָה. וְאִם חָסֵר תְּנַאי אֶחָד מֵהֶן פָּטוּר מִן הַמְּזוּזָה. וְאֵלּוּ הֵן. שֶׁיִּהְיֶה בּוֹ אַרְבַּע אַמּוֹת עַל אַרְבַּע אַמּוֹת אוֹ יָתֵר. וְשֶׁתִּהְיֶינָה לוֹ שְׁתֵּי מְזוּזוֹת. וְיִהְיֶה לוֹ מַשְׁקוֹף. וְתִהְיֶה לוֹ תִּקְרָה. וְיִהְיוּ לוֹ דְּלָתוֹת. וְיִהְיֶה הַשַּׁעַר גָּבוֹהַּ עֲשָׂרָה טְפָחִים אוֹ יוֹתֵר. וְיִהְיֶה הַבַּיִת חֹל. וְיִהְיֶה עָשׂוּי לְדִירַת אָדָם. וְעָשׂוּי לְדִירַת כָּבוֹד. וְעָשׂוּי לְדִירַת קֶבַע:

There are ten requirements that must be met by a house for the person who dwells within to be obligated to affix a mezuzah. is the obligation of the dweller and not the dwelling. If one of the requirements is lacking, there is no obligation for a mezuzah., postulated by Torah law. They are:a) for the area [of the dwelling] to be four cubits by four cubits or more;b) for it to have two 287:1 and the Kitzur Shulchan Aruch 11:11, which state that if an entrance has a doorpost on the right side and a wall which continues on the left side, a mezuzah should be affixed without a blessing. If the doorpost is on the left side, and the wall continues on the right, there is no need for a mezuzah. doorposts; is required. Note the statements of the Turei Zahav 287:1. (See also Halachah 3.)c) for it to have a lintel;d) for it to have a roof;e) for it to have doors;f) should be placed "on your gates." This expression implies an entrance with doors.The Shulchan Aruch (Yoreh De'ah 286:15) obligates us to place a mezuzah even on entrances which do not have doors. Nevertheless, in deference to the Rambam's opinion, the Siftei Cohen 286:25 states that a person should not recite a blessing when affixing such a mezuzah. (See also Halachah 5.) for the entrance to be at least ten handbreadths high;g) for the dwelling not to be consecrated;h) for it to be intended for human habitation;i) for it to be intended to be used for a dignified dwelling;j) for it to be a permanent dwelling.

בַּיִת שֶׁאֵין לוֹ אַרְבַּע אַמּוֹת עַל אַרְבַּע אַמּוֹת פָּטוּר מִן הַמְּזוּזָה. וְאִם יֵשׁ בּוֹ כְּדֵי לְרַבֵּעַ אַרְבַּע אַמּוֹת עַל אַרְבַּע אַמּוֹת בְּשָׁוֶה אַף עַל פִּי שֶׁהוּא עָגל אוֹ בַּעַל חָמֵשׁ זָוִיּוֹת וְאֵין צָרִיךְ לוֹמַר שֶׁאִם הָיָה אָרְכּוֹ יָתֵר עַל רָחְבּוֹ הוֹאִיל וְיֵשׁ בּוֹ לְרַבֵּעַ אַרְבַּע אַמּוֹת עַל אַרְבַּע אַמּוֹת חַיָּב בִּמְזוּזָה:

A dwelling which is less than four cubits, and 58 centimeters according to the Chazon Ish. by four cubits does not require a mezuzah. If its area is equal to sixteen square cubits, although it is circular, pentagonal, and needless to say, if it is rectangular, explains the advantage of a rectangular shape based on Hilchot Tzara'at 14:6, which states that only a square or rectangular-shaped building is considered to be a house with regard to the impurity of tzara'at. since its area is equal to the above-mentioned figure, it requires a mezuzah. (Yoreh De'ah 286:13) accepts the Rambam's view, in deference to Rabbenu Asher's opinion, the Siftei Cohen 286:23 states that one should not recite a blessing when affixing such a mezuzah.The Merchevat HaMishneh does not agree with the Shulchan Aruch's interpretation of the Rambam's words, and explains that the Rambam is referring to a circular building whose circumference is large enough to contain a square four cubits by four cubits. Compare with Hilchot Sukkah 4:7.As explained in Halachah 8, a mezuzah must be affixed to an entrance which leads to another entrance which requires a mezuzah even if the former entrance would not require a mezuzah in its own right. Accordingly, we must say that this halachah is speaking about an independent structure and not a room in a house.

אַכְסַדְרָה וְהוּא הַמָּקוֹם שֶׁיֵּשׁ לוֹ שְׁלֹשָׁה כְּתָלִים וְתִקְרָה אַף עַל פִּי שֶׁיֵּשׁ לָהּ שְׁנֵי פַּצִּימִין בְּרוּחַ רְבִיעִית פְּטוּרָה מִן הַמְּזוּזָה. מִפְּנֵי שֶׁהַפַּצִּימִין לְהַעֲמִיד הַתִּקְרָה הֵם עֲשׂוּיִים וְלֹא מִשּׁוּם מְזוּזוֹת נַעֲשׂוּ. וְכֵן הַתִּקְרָה שֶׁאֵין לָהּ כְּתָלִים אֶלָּא עוֹמֶדֶת עַל עַמּוּדִים מִכָּאן וּמִכָּאן אַף עַל פִּי שֶׁהִיא כְּתַבְנִית בַּיִת פְּטוּרָה לְפִי שֶׁאֵין לָהּ מְזוּזוֹת. שֶׁאֵלּוּ הָעַמּוּדִים לְהַעֲמִיד הַתִּקְרָה הֵן עֲשׂוּיִין:

An excedra, a structure with three walls and a roof, 4:8,9.)It was covered by a roof which contained an aperture to allow sunlight to enter. Decorative pillars were placed at each of the corners of the aperture. does not require a mezuzah even though it has two pillars on the fourth side., this decision applies even if doors are affixed to the pillars. Though the pillars resemble the doorposts of an entrance, a mezuzah is not required because The pillars are intended as supports for the roof, and not as doorposts. (Yoreh De'ah 286:6) states that if the excedra has a wall (even if it is low) on the fourth side as well, a mezuzah is required. According to this decision, most porches that have pillars at their entrance require a mezuzah.Similarly, a roof without walls is required (Shulchan Aruch, Yoreh De'ah, loc. cit.). which stands on pillars, even though shaped like a house, does not require a mezuzah, because it has no doorposts. The pillars are intended to support the roof. 33b.

בַּיִת שֶׁיֵּשׁ לוֹ מְזוּזָה מִכָּאן וּמִכָּאן וְכִפָּה כְּמִין קֶשֶׁת עַל שְׁתֵּי הַמְּזוּזוֹת בִּמְקוֹם הַמַּשְׁקוֹף. אִם יֵשׁ בְּגֹבַהּ הַמְּזוּזוֹת עֲשָׂרָה טְפָחִים אוֹ יָתֵר חַיָּב בִּמְזוּזָה. וְאִם אֵין בָּהֶן עֲשָׂרָה טְפָחִים פְּטוּרִין מִפְּנֵי שֶׁאֵין לוֹ מַשְׁקוֹף:

[The following rules apply to] a house which has a doorpost on either side and an arch above the two doorposts instead of a lintel. If the doorposts are ten handbreadths high or more, it requires a mezuzah. If they are not ten handbreadths high, [the entrance] does not require [a mezuzah], because it does not have a lintel. is not required, most maintain that the reason is not that the entrance does not have a lintel - for the arch takes the place of the lintel - but rather because the entrance is not of the required height, ten handbreadths.The Turei Zahav 287:3 explains that were the doorposts to be ten handbreadths high, the archway would be considered as the lintel. Since they are not ten handbreadths high, the archway is considered to be part of the doorposts, and thus, the entrance is considered to be lacking a lintel.

בַּיִת שֶׁאֵין לוֹ תִּקְרָה פָּטוּר מִן הַמְּזוּזָה. הָיָה מִקְצָתוֹ מְקֹרֶה וּמִקְצָתוֹ אֵינוֹ מְקֹרֶה יֵרָאֶה לִי שֶׁאִם הָיָה הַקֵּרוּי כְּנֶגֶד הַפֶּתַח שֶׁהוּא חַיָּב בִּמְזוּזָה וּמַעֲמִידִין הַדְּלָתוֹת וְאַחַר כָּךְ קוֹבְעִין אֶת הַמְּזוּזָה:

A house that does not have a roof does not require a mezuzah. even though the area enclosed by its walls is open, a house is different; unless it is covered by a roof, it does not require a mezuzah. (See Yoma 11b.) If a portion of [a building] was covered by a roof and a portion was not, the [following ruling] appears to me, the expression "appears to me" indicates a decision for which the Rambam has no explicit source in the texts of the previous generations. [as appropriate]: If the covered portion is near the entrance, 286:14). Note, however, the Or Sameach, which does not require the covered portion to be this size. it requires a mezuzah. 286:13, which states that a part of a house which is customarily built without a roof requires a mezuzah.The doors should be attached, and afterwards, a mezuzah affixed. 33a, is accepted by all halachic authorities (See Shulchan Aruch, Yoreh De'ah 289:3), its interpretation has been a source of controversy based on the difference of opinion (see Halachah 1) between the Rambam and other authorities whether an entrance without doors requires a mezuzah or not. The Talmud states:The exilarch built a house. He requested of Rav Nachman: "Affix a mezuzah for me."Rav Nachman told him: "Attach the doors first."The commentaries maintain that, according to the Rambam, Rav Nachman was telling the exilarch that if the doors were not attached before the mezuzah was affixed, it is invalid. Since an entrance without doors does not require a mezuzah, affixing it before the doors would create a problem: as explained in Chapter 5, Halachah 8, the doors must be affixed first. Other authorities explain that Rav Nachman made this statement only because it was necessary to determine the direction the doors would open in order to establish the proper side of the doorway on which to place the mezuzah.

הַר הַבַּיִת הַלְּשָׁכוֹת וְהָעֲזָרוֹת וּבָתֵּי כְּנֵסִיּוֹת וּבָתֵּי מִדְרָשׁוֹת שֶׁאֵין בָּהֶן בֵּית דִּירָה פְּטוּרִין לְפִי שֶׁהֵן קֹדֶשׁ. בֵּית הַכְּנֶסֶת שֶׁל כְּפָרִים שֶׁהָאוֹרְחִין דָּרִין בּוֹ חַיָּב בִּמְזוּזָה. וְכֵן בֵּית הַכְּנֶסֶת שֶׁל כְּרַכִּין אִם הָיָה בּוֹ בֵּית דִּירָה חַיָּב. כָּל הַשְּׁעָרִים שֶׁהָיוּ בַּמִּקְדָּשׁ לֹא הָיָה לָהֶם מְזוּזוֹת חוּץ מִשַּׁעַר נִקָּנוֹר וְשֶׁלְּפָנִים מִמֶּנּוּ. וְשֶׁל לִשְׁכַּת פַּרְהֶדְרִין מִפְּנֵי שֶׁהַלִּשְׁכָּה הַזֹּאת הָיְתָה בֵּית דִּירָה לְכֹהֵן גָּדוֹל בְּשִׁבְעַת יְמֵי הַהַפְרָשָׁה:

[The gates to] the Temple Mount, 5:2. its chambers, courtyards,, Chapter 5. and, similarly, entrances to synagogues 29a) and houses of study there (Tur, Yoreh De'ah 286). The Shulchan Aruch (286:10) suggests affixing a mezuzah without reciting a blessing beforehand. which do not have apartments in which people live do not require mezuzot, because they are consecrated. 11b derives this concept from the exegesis of Deuteronomy 6:9: "And you shall write them on the doorposts of your homes." The Temple is not "your home," a private dwelling, and therefore does not require a mezuzah.The Chatam Sofer (Yoreh De'ah, Responsum 281) asks: Since the Chamber of Parhedrin was the only portion within the Temple Courtyard used as a person's dwelling, why does the Rambam state that these entrances do not require mezuzot because they are consecrated? Since they are not used as a dwelling, why would one think they require a mezuzah?The Chatam Sofer explains that the Temple is a dwelling - in fact, the ultimate dwelling, the resting place of the Divine Presence. Nevertheless, since it is not a dwelling for humans, it does not require a mezuzah.A synagogue in a village in which guests reside requires a mezuzah. Similarly, a synagogue in a metropolis, if it has an apartment, requires a mezuzah. (Halachot Katanot) explains that synagogues in villages would generally have apartments for guests, because the villagers' homes were usually not large enough to accommodate them. In contrast, in large cities, there were generally enough people willing to invite guests to their homes, and thus it was unnecessary for a synagogue to have a guest apartment.All the gates in the Temple complex did not have mezuzot, with the exception of the Gate of Nicanor 5:5.)The Gate of Nicanor required a mezuzah because it was the gate directly before the Chamber of Parhedrin. As explained in Halachah 8, the gate of a courtyard which leads to a dwelling requires a mezuzah. Based on this rationale, Rav Kapach asks why the gates before the Gate of Nicanor did not require a mezuzah, since they led to a gate which led to a dwelling. and those further within, and others note that the Rambam's text differs from his source (Yoma, loc. cit.), which reads "the Gate of Nicanor and the Chamber of Parhedrin, which was further within." He does explain, however, that the Rambam's version is acceptable: Since all these gates lead to the Chamber of Parhedrin, they therefore require a mezuzah.Rav Kapach supports this interpretation, noting that the Chamber of the Hearth also served as a dwelling for the priests, and hence, the gate to it would require a mezuzah. According to this interpretation, this gate is also included, while according to our text of the Talmud, it is not. and the entrance to the Chamber of Parhedrin, 8b). because this chamber served as a dwelling for the High Priest during the seven days 10b, which states that the obligation to place a mezuzah on the gate of Nicanor and the Chamber of Parhedrin applies only during these seven days and not throughout the entire year. Nevertheless, since as stated in Chapter 5, Halachah 11, one should not remove a mezuzah after leaving a dwelling, the mezuzah should remain there (Rav Kapach). when he was separated [from his home in preparation for the Yom Kippur service]. 2a, Hilchot Avodat Yom HaKippurim 1:3.

בֵּית הַתֶּבֶן בֵּית הַבָּקָר בֵּית הָעֵצִים בֵּית אוֹצָרוֹת פְּטוּרִין מִן הַמְּזוּזָה, שֶׁנֶּאֱמַר בֵּיתֶךָ, בֵּיתְךָ הַמְיֻחָד לְךָ, פְּרַט לְאֵלּוּ וְכַיּוֹצֵא בָּהֶן. לְפִיכָךְ רֶפֶת הַבָּקָר שֶׁהַנָּשִׁים יוֹשְׁבוֹת בָּהּ וּמִתִקַשִּׁטוֹת בָּהּ חַיָּבוֹת בִּמִזוּזָה שֵׁהֲרֵי יֵשׁ בָּהּ יִחוּד לְדִירַת אָדָם. בֵּית שַׁעַר אַכְסַדְרָה וּמִרְפֶּסֶת וְהַגִּנָּה וְהַדִּיר פְּטוּרִין מִן הַמְּזוּזָה מִפְּנֵי שֶׁאֵינָם עֲשׂוּיִין לְדִירָה. אִם הָיוּ בָּתִּים הַחַיָּבִין בִּמְזוּזָה פְּתוּחִין לִמְקוֹמוֹת אֵלּוּ חַיָּבִין בִּמְזוּזָה:

A storage house for straw, a barn for cattle, a woodshed, or [other] storage rooms 7:5, where the Rambam states that a soldier who is excused from the battlefield for building a new house (see Deuteronomy 20:5), is released for constructing one of these structures.He explains, however, that the Rambam's phraseology clearly indicates how this difficulty can be resolved. In Hilchot Melachim, the Rambam states that these structures are "fit to dwell in." In this halachah, he states that they are not "set aside for their use."A house requires a mezuzah only when a person dwells in it. Accordingly, since these structures are not used for that purpose, they do not require a mezuzah. To receive an exemption from military service, all that is necessary is to build a house "fit to dwell in." Since it is possible to use these structures for that purpose, the exemption is granted. do not require a mezuzah [as can be inferred from Deuteronomy 6:9, which requires that a mezuzah be placed on] "your homes" and others, the Shulchan Aruch (Yoreh De'ah 286:1-2) requires that a mezuzah be affixed to such structures. - i.e., a house which is set aside for your use - thus excluding the above and their like.Therefore, [if] a barn [is also used] by women as a dressing room, (Yoreh De'ah 286:2) emphasizes that if the women stand there naked, it is improper for a mezuzah to be affixed. it requires a mezuzah, since it is used as a dwelling by a human being.. A guardhouse, an excedra, a porch, a garden, and a corral do not require a mezuzah (Yoreh De'ah 286) and other Ashkenazic authorities, which obligate placing a mezuzah on these structures if they conform to all the other necessary requirements. since they are not dwellings. If dwellings which require a mezuzah open up to these structures, to be placed upon it. they require a mezuzah. 286:8).

לְפִיכָךְ אֶחָד שַׁעֲרֵי חֲצֵרוֹת וְאֶחָד שַׁעֲרֵי מְבוֹאוֹת וְאֶחָד שַׁעֲרֵי מְדִינוֹת וַעֲיָרוֹת הַכּל חַיָּבִים בִּמְזוּזָה שֶׁהֲרֵי הַבָּתִּים הַחַיָּבִין בִּמְזוּזָה פְּתוּחִין לְתוֹכָן. אֲפִלּוּ עֲשָׂרָה בָּתִּים זֶה פָּתוּחַ לְזֶה וְזֶה פָּתוּחַ לְזֶה הוֹאִיל וְהַפְּנִימִי חַיָּב בִּמְזוּזָה כֻּלָּן חַיָּבִין. וּמִפְּנֵי זֶה אָמְרוּ שַׁעַר הַפָּתוּחַ מִן הַגִּנָּה לֶחָצֵר חַיָּב בִּמְזוּזָה:

Accordingly, gates to courtyards, gates to alleys, and gates to cities and towns, all require a mezuzah, since houses which require a mezuzah open up to them. 11a relates that the obligation to affix mezuzot on such structures is derived from the inclusion of the word, "And on your gates" (Deuteronomy 6:9 . This implies that even structures which are not themselves "homes" should have mezuzot on their entrances. Even when there are ten structures loosely. Manuscript copies of the Mishneh Torah substitute the term "entrances." leading one to each other, should the innermost one require a mezuzah, they all require [mezuzot]. Therefore, [our Sages] stated: A gate which opens up from a garden to a courtyard requires a mezuzah. 33b. The passage there, however, speaks of a gate leading from a room to a garden or from a room to a courtyard. The Kiryat Melech cites a reference in Chapter 2 of the tractate of Mezuzah, which describes precisely the situation mentioned by the Rambam.

בֵּית הַכִּסֵּא וּבֵית הַמֶּרְחָץ וּבֵית הַטְּבִילָה וּבֵית הַבֻּרְסְקִי וְכַיּוֹצֵא בָּהֶם פְּטוּרִין מִן הַמְּזוּזָה לְפִי שֶׁאֵינָן עֲשׂוּיִין לְדִירַת כָּבוֹד. סֻכַּת חַג בֶּחָג וּבַיִת שֶׁבַּסְּפִינָה פְּטוּרִין מִן הַמְּזוּזָה לְפִי שֶׁאֵינָן עֲשׂוּיִין לְדִירַת קֶבַע. שְׁתֵּי סֻכּוֹת שֶׁל יוֹצְרִים זוֹ לְפָנִים מִזּוֹ הַחִיצוֹנָה פְּטוּרָה מִן הַמְּזוּזָה לְפִי שֶׁאֵינָהּ קְבוּעָה. הַחֲנֻיּוֹת שֶׁבַּשְּׁוָקִים פְּטוּרִין מִפְּנֵי שֶׁאֵינָן קְבוּעִים לְדִירָה:

A toilet, a bathhouse, a mikveh, a tannery, and the like, do not require a mezuzah, since they do not constitute a dignified dwelling. 11b explains that this exclusion is implied by the commandment to place a mezuzah on our "homes." Only a dignified dwelling, like a home, requires a mezuzah.A sukkah on the holiday of Sukkot, would be required. and a house on a ship, and the Jerusalem Talmud, Megillah 4:12.The latter source compares tefillin to mezuzah and explains that the mitzvah of tefillin has an advantage, because it is fulfilled by those who travel in the desert or journey upon the sea. From this, one can conclude that the mitzvah of mezuzah is not fulfilled at sea. do not require a mezuzah, for they do not constitute a permanent dwelling. (Yoreh De'ah 286) exempts patients in a hospital or inmates in prison of the obligation to have a mezuzah on their doors.Similarly,[With regard to] the two booths of a potter, one inside the other: 8b). The inner booth requires a mezuzah. However, The outer booth does not require a mezuzah, (loc. cit.) asks: Although the outer booth is not a dwelling and, therefore, does not, in and of itself, require a mezuzah, perhaps a mezuzah should be affixed because it leads to the inner booth? The Talmud answers because it is not a permanent structure. (Kessef Mishneh). Note the Ra'avad and Rashi, who interpret the passage from Sukkah differently. Stores in a market place do not require a mezuzah because they are not permanently used as a dwelling. 11:14, which states that this law applies only to stalls used for business fairs that are left vacant after the fair is over. If, however, merchandise is continually left in a store, a mezuzah is required.

בַּיִת שֶׁיֵּשׁ לוֹ פְּתָחִים הַרְבֵּה אַף עַל פִּי שֶׁאֵינוֹ רָגִיל לָצֵאת וְלָבוֹא אֶלָּא בְּאַחַת מֵהֶן חַיָּב לַעֲשׂוֹת מְזוּזָה בְּכָל פֶּתַח וּפֶתַח. פֶּתַח קָטָן שֶׁבֵּין בַּיִת לַעֲלִיָּה חַיָּב בִּמְזוּזָה. חֶדֶר שֶׁבַּבַּיִת אֲפִלּוּ חֶדֶר בְּחֶדֶר חַיָּב לַעֲשׂוֹת מְזוּזָה עַל שַׁעַר הַחֶדֶר הַפְּנִימִי וְעַל שַׁעַר הַחֶדֶר הַחִיצוֹן וְעַל שַׁעַר הַבַּיִת שֶׁכֻּלָּן עֲשׂוּיִין לְדִירָה וּקְבוּעִין:

A dwelling which has many doorways requires a mezuzah for each and every doorway, even though one generally enters and leaves through only one of them. is required. If, however, the doorway is barred closed so that it will not be used, no mezuzah is necessary.A small entrance between a dwelling and a loft requires a mezuzah.. Perhaps the Rambam is implying that a mezuzah is required even though the opening lies horizontally in the roof of the house. There is a difference of opinion on this matter, and the Kitzur Shulchan Aruch 11:20 requires a mezuzah only on an entrance that stands upright. When there is a separate room in a house, or even one room which leads to another room, it is necessary to affix a mezuzah on the doorway to the innermost room, the doorway to the outer room, and the doorway to the house, in a house. since all of them are used for the purpose of dwelling and are permanent structures. states that this law is self-evident, based on the Rambam's statements in Halachah 8. The commentaries explain, however, that the above halachah describes a situation where many entrances require a mezuzah because of another room. In this instance, each of the rooms itself requires a mezuzah.

פֶּתַח שֶׁבֵּין בֵּית הַמִּדְרָשׁ אוֹ בֵּין בֵּית הַכְּנֶסֶת וּבֵיתוֹ אִם רָגִיל לָצֵאת וְלָבוֹא בְּאוֹתוֹ הַפֶּתַח חַיָּב בִּמְזוּזָה. פֶּתַח שֶׁבֵּין שְׁנֵי בָּתִּים הוֹלְכִין אַחַר הַצִּיר שֶׁל דֶּלֶת, מָקוֹם שֶׁהַצִּיר נִרְאֶה עִמּוֹ שָׁם קוֹבְעִים אֶת הַמְּזוּזָה:

When a person frequently enters and leaves through an entrance between a synagogue and a house of study, as mentioned in Halachah 6 above, and his own house, that entrance requires a mezuzah.When there is an entrance between two houses, [the position of the mezuzah] is determined by the door-hinge. (Menachot 33a). The mezuzah is placed on the side on which the hinge can be seen. should be placed. The Rambam explains that this is determined by the direction to which the door opens: The mezuzah is placed on the right side of the entrance to the room to which the door opens.The Shulchan Aruch (Yoreh De'ah 289:3) quotes the Rambam's decision. The Turei Zahav 289:4 and the Siftei Cohen 289:6 mention two other factors:a) The order in which one enters the rooms from the entrance to the house. The room which is closer to the entrance to the house is considered as leading to the room which is further removed, and the mezuzah is placed on the right side of the entrance to the latter room;b) The importance of the rooms. The room which is less important is considered as leading into the room which is more important, and the mezuzah is placed on the right side of the entrance to the latter room.These principles are also significant if an entrance has no doors or has sliding doors. The above concepts apply only to rooms within a house. If the door leads to the public thoroughfare, the mezuzah is always placed on the right-hand side as one enters the house.

וְהֵיכָן קוֹבְעִים אֶת הַמְּזוּזָה. בְּתוֹךְ חָלָל שֶׁל פָּתַח בַּטֶּפַח הַסָּמוּךְ לַחוּץ בִּתְחִלַּת שְׁלִישׁ הָעֶלְיוֹן שֶׁל גֹּבַהּ הַשַּׁעַר. וְאִם קְבָעָהּ לְמַעְלָה מִזֶּה כְּשֵׁרָה. וְהוּא שֶׁיַּרְחִיקֶנָּה מִן הַמַּשְׁקוֹף טֶפַח. וְצָרִיךְ לְקָבְעָהּ עַל יְמִין הַנִּכְנָס לַבַּיִת וְאִם קְבָעָהּ מִשְּׂמֹאל פְּסוּלָה. וּבַיִת שֶׁל שֻׁתָּפִין חַיָּב בִּמְזוּזָה:

Where is the mezuzah affixed? At the inside of the entrance, 32b explains that the Hebrew uvish'arecha, translated as "on your gates," can also be rendered "within your gates." Note the commentary on Chapter 5, Halachah 8, which explains that, when there is no other alternative, the mezuzah may be affixed inside the entrance, on the back of the doorpost. within a handbreadth of the outer edge of the doorpost, 33b gives two reasons for this position: a) so that one will encounter God's name as soon as one enters one's home;b) so that the protective influences aroused by the mezuzah will affect a greater portion of the home. at the beginning of the top third of the entrance. 33a derives this concept from the fact that the Torah teaches the mitzvah of mezuzah directly after the mitzvah of tefillin. Just as tefillin are placed on the upper portion of one's arm, a mezuzah should be placed on the upper portion of the entrance. (Note the Nekudot HaKessef 289, who objects to this decision.) If it was affixed higher up, should be placed at the height of one's shoulders. (See Siftei Cohen 289:4.) it is acceptable as long as it is at least a handbreadth below the lintel. may be placed next to the lintel.It must be placed at the right-hand side 289:2). as one enters the house. 11b explains that the word veitecha, "your house," can also be interpreted, "as you enter," implying that the mezuzah should be positioned as one enters a house or room. If it is placed on the left-hand side, it is invalid.A house belonging to partners requires a mezuzah., loc. cit., explains that although Deuteronomy 6:9 uses the singular form for "your house," it does not exclude houses belonging jointly to many people.The Kessef Mishneh relates that it would have been more appropriate to mention this law at the beginning of the chapter; nevertheless, the Rambam mentions it here because it is derived from the same Talmudic passage as the preceding law.Note the Kitzur Shulchan Aruch 11:19, which states that an entrance which one shares with a gentile does not require a mezuzah.

חַיָּב אָדָם לְהִזָּהֵר בִּמְזוּזָה מִפְּנֵי שֶׁהִיא חוֹבַת הַכּל תָּמִיד. וְכָל זְמַן שֶׁיִּכָּנֵס וְיֵצֵא יִפְגַּע בְּיִחוּד הַשֵּׁם שְׁמוֹ שֶׁל הַקָּדוֹשׁ בָּרוּךְ הוּא וְיִזְכֹּר אַהֲבָתוֹ וְיֵעוֹר מִשְּׁנָתוֹ וְשִׁגְיוֹתָיו בְּהַבְלֵי הַזְּמַן. וְיֵדַע שֶׁאֵין דָּבָר הָעוֹמֵד לְעוֹלָם וּלְעוֹלְמֵי עוֹלָמִים אֶלָּא יְדִיעַת צוּר הָעוֹלָם. וּמִיָּד הוּא חוֹזֵר לְדַעְתּוֹ וְהוֹלֵךְ בְּדַרְכֵי מֵישָׁרִים. אָמְרוּ חֲכָמִים הָרִאשׁוֹנִים כָּל מִי שֶׁיֵּשׁ לוֹ תְּפִלִּין בְּרֹאשׁוֹ וּבִזְרוֹעוֹ וְצִיצִית בְּבִגְדוֹ וּמְזוּזָה בְּפִתְחוֹ מֻחְזָק הוּא שֶׁלֹּא יֶחֱטָא שֶׁהֲרֵי יֵשׁ לוֹ מַזְכִּירִין רַבִּים וְהֵן הֵם הַמַּלְאָכִים שֶׁמַּצִּילִין אוֹתוֹ מִלַּחֲטֹא שֶׁנֶּאֱמַר (תהילים לד ח) ״חֹנֶה מַלְאַךְ יְיָ׳‎ סָבִיב לִירֵאָיו וַיְחַלְּצֵם״:

A person must show great care in [the observance of the mitzvah of] mezuzah, because it is an obligation which is constantly incumbent upon everyone.[Through its observance,] whenever a person enters or leaves [the house], he will encounter the unity of the name of the Holy One, blessed be He, and remember his love for Him. Thus, he will awake from his sleep and his obsession with the vanities of time, and recognize that there is nothing which lasts for eternity except the knowledge of the Creator of the world. This will motivate him to regain full awareness and follow the paths of the upright.Whoever wears tefillin on his head and arm, wears tzitzit on his garment, and has a mezuzah on his entrance, can be assured that he will not sin, because he has many who will remind him. These are the angels, who will prevent him from sinning, as [Psalms 34:8] states: "The angel of God camps around those who fear Him and protects them."Blessed be God who offers assistance.