Ordinarily, we expect a person to prepare himself for Yom Tov by shaving, cutting his hair, etc. In order to ensure that people do not postpone doing so until Hol HaMoed – which would leave them “untrimmed” for the beginning of the holiday – the Sages forbid haircuts throughout the days of Hol HaMoed.
The first Mishna in the third perek of Massekhet Moed Katan teaches that if a person was in a situation that did not allow for proper preparation for the holiday – for example, an ocean traveler (the Ritva says that this applies to any traveler who reaches his city just before the holiday begins or on Hol HaMoed itself), a captive who was freed, or someone released from prison – he would be permitted to shave during Hol HaMoed. In these (and similar) cases, the Sages recognized that their regulation should not apply.
Is all travel recognized as legitimate? Rava explains that someone who was traveling on business to support his family is certainly permitted to shave upon his return, while someone who was on a pleasure trip would not be allowed special dispensation. The question remains in the case of someone who traveled in the hope of profiting in business beyond his basic needs. In such a case, the tanna of our Mishna is understood to permit shaving, while Rabbi Yehuda is quoted in our Gemara as forbidding it, since his travel is considered to be she-lo birshut – without permission.
Rashi, the Ran, and many other rishonim understand the ruling of she-lo birshut to mean that the person left for his own reasons, but was not really forced to do so. Their approach is that according to Rabbi Yehuda, a person who must travel to support his family is considered an anoos – someone who is forced into a situation that is beyond his control – and in such cases we recognize the need for leniency. The person who chooses to travel for profit has no grounds to demand special consideration.
Another approach is offered by the Ra’avad , Ritva, Meiri and others. They suggest that Rabbi Yehuda’s comment of she-lo birshut refers specifically to someone who leaves Israel and travels to the Diaspora. In such a case, the travel is undertaken “without permission” and no dispensation can be allowed, unless the individual is in a situation where he cannot support his family otherwise. According to this approach, if someone was traveling for profit – or even for pleasure – and remained within the boundaries of the Land of Israel, Rabbi Yehuda would agree that he was acting birshut (i.e. within the bounds of acceptable halakhic behavior) and would, therefore, be permitted to shave on Hol HaMoed upon his return home.