Another example is eating while fasting: if a fasting person eats, his fast is invalidated, because the prohibition pertains to an act specific to the worship itself—namely, fasting.
A third example is that if he has intercourse while in ihram, his ihram is invalidated. The evidence is the saying of Allah, Most High: “Whoever undertakes the obligation of Hajj therein, then there is to be no sexual relations, no disobedience, and no disputing during Hajj.” [2:197]
If he shaves his head while in ihram, the prohibition here pertains to an act specific to the worship, for Allah, Most High, says: “And do not shave your heads until the sacrificial animal has reached its place of slaughter.” [2:196] So, is his ihram invalidated because the prohibition pertains to an act specific to the worship?
The answer is that either there is evidence specifying this particular issue, or ihram is invalidated by shaving.
The Zahiris held that ihram is invalidated, saying: Performing the acts prohibited during ihram invalidates ihram.
As for the hadith of Ka'b ibn Ujrah (1), may Allah be pleased with him, their response is that Allah, Mighty and Majestic, permitted one who is ill or suffers an ailment of the head to shave and offer expiation. Such a person is permitted to do so because of his excuse, and the excused and unexcused persons are not alike. Once he has an excuse, shaving becomes lawful for him rather than prohibited; thus, if he does it in this state, he has not committed a prohibited act.
They then said: We argue against you by analogy, even though we do not accept it; rather, we hold you to it because you accept it. Why do you say that, if he has intercourse