Siman 364
Presented here for study, not as a practical ruling. The Shulchan Aruch rules by Sephardi custom, the Rema's glosses by Ashkenazi custom, and the Kitzur follows Ashkenazi custom. For a practical question, ask your rabbi.
א מָבוֹי הַמְּפֻלָּשׁ בִּשְׁנֵי רָאשָׁיו לִרְשׁוּת הָרַבִּים, אוֹ צַד אֶחָד לִרְשׁוּת הָרַבִּים וְצִדּוֹ הַשֵּׁנִי לְכַרְמְלִית, הַגָּה: אוֹ שְׁנֵי רָאשָׁיו פְּתוּחִין לְכַרְמְלִית (ריב"ש סִימָן ת"ה), צָרִיךְ צוּרַת הַפֶּתַח מִכָּאן וְלֶחִי אוֹ קוֹרָה מִכָּאן. אֲבָל אִם צִדּוֹ אֶחָד פָּתוּחַ לִרְשׁוּת הָרַבִּים וְצִדּוֹ הַשֵּׁנִי לְחָצֵר שֶׁאֵינָהּ מְעֹרֶבֶת, אֵין צָרִיךְ אֶלָּא לֶחִי אוֹ קוֹרָה בִּשְׁנֵי רָאשָׁיו. הַגָּה: וְכָל זֶה שֶׁיֵּשׁ לוֹ תְּנָאִים הַמְבֹאָרִים לְעֵיל סי' שס"ג (סכ"ו) בְּדִין מָבוֹי, אֲבָל אִם אֵינוֹ רַק כְּחָצֵר, צָרִיךְ תִּקּוּן חָצֵר מִשְּׁנֵי צְדָדָיו.
1 Laws of a Pass-Through Alleyway and One Shaped Like the Letter Nun — 5 Sections A pass-through alleyway open at both ends to a public domain, or with one side opening to a public domain and the other to a karmelit— or with both ends opening to a karmelit requires a doorframe shape on one side and a lechi or beam on the other. But if one side opens to a public domain and the other to an uneruvated courtyard, only a lechi or beam is needed at each of the two ends.All of this is subject to the conditions explained above in Siman 363, section 27, regarding the laws of an alleyway. But if it is entirely within a courtyard, it requires the courtyard arrangement on both sides.
ב רְשׁוּת הָרַבִּים עַצְמָהּ אֵינָהּ נִתֶּרֶת אֶלָּא בַּדְּלָתוֹת, וְהוּא שֶׁנִּנְעָלוֹת בַּלַּיְלָה. וְיֵשׁ אוֹמְרִים אַף עַל פִּי שֶׁאֵין נִנְעָלוֹת אֲבָל צָרִיךְ שֶׁיִּהְיוּ רְאוּיוֹת לִנָּעֵל, שֶׁאִם מְשֻׁקָּעוֹת בְּעָפָר, מְפַנֶּה אוֹתָן וּמְתַקְּנָן שֶׁיִּהְיוּ רְאוּיוֹת לִנָּעֵל. וְאַחַר שֶׁעָשָׂה לָהּ תִּקּוּן דְּלָתוֹת חֲשִׁיבָה כֻּלָּהּ כְּחָצֵר אֶחָד וְאֵין מְבוֹאוֹתֶיהָ צְרִיכִין תִּקּוּן.
2 A public domain itself can only be rectified with doors, and they must be locked at night. Some say that even if they are not locked, they must at least be fit to be locked — so if they are sunken in the ground, one clears them and fixes them so they are fit to be locked. Once the door arrangement is made, the entire area is considered a single courtyard and its alleyways require no further arrangement.
ג מָבוֹי עָקֹם כְּמִין דָּלֶ"ת, דִּינוֹ כְּאִלּוּ הָיָה מְפֻלָּשׁ בְּעַקְמִימוּת וְצָרִיךְ צוּרַת פֶּתַח בְּעַקְמִימוּתוֹ וּבִשְׁנֵי רָאשָׁיו, לְכָל אֶחָד לֶחִי, אוֹ קוֹרָה, אוֹ צוּרַת פֶּתַח בְּכָל אֶחָד מִשְּׁנֵי רָאשָׁיו וְלֶחִי, אוֹ קוֹרָה, בְּעַקְמִימוּת, וְאִם עָשׂוּי כְּמִין חֵי"ת, צָרִיךְ צוּרַת פֶּתַח בִּשְׁנֵי עַקְמִימוֹתָיו וְלֶחִי, אוֹ קוֹרָה, בִּשְׁנֵי רָאשָׁיו.
3 A bent alleyway shaped like the letter dalet is treated as if it were a pass-through alleyway at the bend, and requires a doorframe shape at the bend. At each of its two ends it needs either a lechi, beam, or doorframe shape — and a lechi or beam at the bend. If it is shaped like the letter chet, it requires a doorframe shape at each of its two bends, and a lechi or beam at each of its two ends.
ד מְבוֹאוֹת הַפְּתוּחִים אֵלּוּ לְאֵלּוּ וְאֵין הָעִקּוּם שֶׁל אֶחָד מֵהֶם נוֹטֶה לִרְשׁוּת הָרַבִּים, כֵּיוָן שֶׁפְּתִיחַת הַמָּבוֹי הַחִיצוֹן לִרְשׁוּת הָרַבִּים, הֲרֵי אוֹתוֹ מָבוֹי שֶׁפָּתוּחַ אֵלָיו בְּעַקְמִימוּתוֹ חָשִׁיב כְּפָתוּחַ לִרְשׁוּת הָרַבִּים, וְכֵן מָבוֹי הַפָּתוּחַ לְאוֹתוֹ מָבוֹי, וְכֵן כֻּלָּם.
4 Alleyways that open into one another — when the bend of one of them does not face the public domain — since the outer alleyway opens to the public domain, the alleyway that opens into it at its bend is considered as if it opens to the public domain. And so too the alleyway that opens into that one, and so on for all of them.
ה מָבוֹי הֶעָשׂוּי כְּנָדָל, דְּהַיְנוּ מָבוֹי גָּדוֹל שֶׁהַרְבֵּה מְבוֹאוֹת קְטַנִּים פְּתוּחִים לוֹ, וְרָאשֵׁי הַשְּׁנִיִּים פְּתוּחִים לִרְשׁוּת הָרַבִּים, אֲפִלּוּ אֵין פִּתְחֵי הַקְּטַנִּים שֶׁמִּכָּאן וּמִכָּאן מְכֻוָּנִים זֶה כְּנֶגֶד זֶה, עוֹשֶׂה לְכָל א' בִּמְקוֹם פְּתִיחָתוֹ לְמָבוֹי גָּדוֹל צוּרַת פֶּתַח, וּבְרֹאשׁוֹ הַשֵּׁנִי הַפָּתוּחַ לִרְשׁוּת הָרַבִּים לֶחִי, אוֹ קוֹרָה. וּבַמָּבוֹי הַגָּדוֹל, אִם הוּא מְפֻלָּשׁ עוֹשֶׂה צוּרַת פֶּתַח מִצַּד אֶחָד וּמִצִּדּוֹ הַשֵּׁנִי לֶחִי אוֹ קוֹרָה. וְאִם הוּא סָתוּם, עוֹשֶׂה לֶחִי, אוֹ קוֹרָה, בְּרֹאשׁוֹ.
5 An alleyway shaped like the letter nun meaning a large alleyway into which many small alleyways open, with the other ends of the small ones opening to the public domain — even if the openings of the small alleyways on each side do not directly face one another: one makes a doorframe shape for each small alleyway at the point where it opens into the large alleyway, and a lechi or beam at its other end which opens to the public domain. As for the large alleyway itself: if it is a pass-through, one makes a doorframe shape on one side and a lechi or beam on the other; if it is closed at one end, one makes a lechi or beam at its open end.