שֶׁלֹּא לַעֲבֹד עֲבוֹדָה זָרָה בְּמָה שֶׁדַּרְכָּהּ לְהֵעָבֵד – שֶׁלֹּא נַעֲבֹד שׁוּם עֲבוֹדָה זָרָה בָּעוֹלָם בִּדְבָרִים שֶׁדַּרְכָּהּ שֶׁעוֹבְדִים אוֹתָהּ הַמַּאֲמִינִים בָּהּ. וְאע"פ שֶׁאֵין עֲבוֹדָתָהּ בְּאַחַת מֵאַרְבַּע עֲבוֹדוֹת שֶׁאָמַרְנוּ לְמַעְלָה, מִכֵּיוָן שֶׁעֲבָדָהּ בְּמָה שֶׁדַּרְכָּהּ לְהֵעָבֵד חַיָּב. וְאע"פ שֶׁעֲבוֹדָתָהּ דֶּרֶךְ בִּזָּיוֹן, כְּגוֹן הַפּוֹעֵר לִפְעוֹר, וְזוֹרֵק אֶבֶן לְמַרְקוּלִיס, וּמַעֲבִיר זַרְעוֹ לִכְמוֹשׁ, שֶׁנֶּאֱמַר (שמות כ ה) וְלָא תָּעָבְדֵם, כְּלוֹמַר בְּמָה שֶׁדַּרְכָּן לְהֵעָבֵד, אֵיזוֹ עֲבוֹדָה שֶׁתִּהְיֶה.
To not worship idolatry in that which is its way to be worshiped: That we not worship any idolatry in the world with the things that are the way of those that believe in it to worship it. And even though its worship is not with one of the four worships that we said above, since he worshiped it with that which is its way to be worshiped, he is liable. And even [if] its worship is in a way of disgrace — for example, one who defecates to Peor, or one who throws stones at Markulis or one who passes his seed to Kamosh — as it is stated (Exodus 20:5), “or worship them,” meaning to say with what is their way to be worshiped, whatever worship it may be.
שָׁרְשָׁהּ יָדוּעַ. דִּינֶיהָ, כְּגוֹן מִי שֶׁעֲבָדָהּ דֶּרֶךְ עֲבוֹדָתָהּ לְכַוָּנַת בִּזָּיוֹן מֶה דִּינוֹ, (סנהדרין סד, א) וּשְׁאָר פְּרָטֶיהָ בְּמַסֶּכֶת ע"ז (שם)
Its root is known. Its laws — for example, what the law is for one who worships it in the way of its worship with the intention of disgracing it (Sanhedrin 64a); and the rest of its details — are in Tractate Avodah Zarah.
וְנוֹהֶגֶת בְּכָל מָקוֹם וּבְכָל זְמַן בִּזְכָרִים וּנְקֵבוֹת וְעוֹבֵר עָלֶיהָ בְּמֵזִיד וְיֵשׁ עֵדִים, נִסְקָל. וּמְבֹאָר דִּין זֶה גַּם כֵּן בְּפֶרֶק ז' מִסַּנְהֶדְרִין. שְׁתֵּי מִצְוֹת אֵלֶּה שֶׁמָּנָה הָרַמְבַּ"ם ז"ל, שֶׁהֵן הִשְׁתַּחֲוָאָה לַע"ז וְכֵן שֶׁלֹּא לְעָבְדָהּ בְּמָה שֶׁדַּרְכָּהּ לְעָבְדָהּ יִכְלְלֵם הָרַמְבַּ"ן ז"ל בְּלָאו דְּלָא יִהְיֶה לְךָ וּכְמוֹ שֶׁכָּתַבְנוּ לְמַעְלָה (במצוה כז) נִמְצָא, שֶׁיְּסַלֵּק שְׁתֵּי מִצְוֹת בְּכָאן מֵחֶשְׁבּוֹנוֹ שֶׁל הָרַב רַבִּי מֹשֶׁה בֶּן מַיְמוֹן ז"ל.
And [it] is practiced in every place and at all times by males and females. And one who transgresses it volitionally and there are witnesses is stoned. And this law is also elucidated in Chapter Seven of Sanhedrin. These two commandments that Rambam, may his memory be blessed, counted — which are bowing down to idolatry and also not to worship it according to how it is its way to be worshiped — Ramban, may his memory be blessed, included in the commandment of “You shall have no,” and as we wrote above (Sefer HaChinukh 27). It comes out that he removes two commandments here from the calculation of Rabbi Moshe Maimonides (Rambam), may his memory be blessed.
