סימן קכז סעיף יב
מִי שֶׁקִּבֵּל עָלָיו לְהִתְעַנּוֹת וּמִצְטַעֵר הַרְבֵּה בְּתַעֲנִיתוֹ, יָכוֹל לִפְדּוֹתָהּ בְּמָמוֹן כְּפִי עָשְׁרוֹ, וְנוֹתֵן אֶת הַדָּמִים לַעֲנִיִּים. אֲבָל בְּתַעֲנִית שֶׁמֵּחֲמַת נֶדֶר, לָא מַהֲנֵי פִּדְיוֹן. וְכֵן בְּתַעֲנִית שֶגָּזְרוּ הַצִּבּור, לָא מַהֲנֵי פִּדְיוֹן, אֶלָּא אִם כֵּן הִתְנוּ כֵן הַצִּבּוּר.
If you undertook to fast, and are experiencing grave discomfort because of it, you may redeem it with money, according to your means, and you should give the money to the poor. But for a fast in fulfillment of a vow, redemption is of no avail. On a fast day, decreed by the community, redemption is also of no avail, unless the community made such a stipulation.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)