WHEN DOES ONE SAY TEFILAS HA'DERECH? [Tefilas ha'Derech: when to say it]
Gemara
(Beraisa - R. Yehudah): If Reuven has one house here and another 4000 Amos away in another city, once he was Machazik b'Derech (starts to go towards his other house), he acquires an Eruv (i.e. Shevisah).
Rav Yehudah bar Ishtesa was leaving R. Noson bar Oshayah [on Erev Shabbos, to go to his house 4000 Amos away]. R. Noson waited until he took a step down from the Aliyah, and told him 'stay tonight, and return tomorrow.'
52b: This is like R. Yehudah [who requires that he was Machazik b'Derech].
Berachos 29a (R. Yakov): Anyone who journeys must say Tefilas ha'Derech.
(R. Yakov): The earliest one may say Tefilas ha'Derech is once he is on the road.
The Shi'ur for Tefilas ha'Derech is a Parsah (8000 Amos, about four kilometers).
Horayos 3b (Mishnah - R. Akiva): If Beis Din ruled, realized their mistake and retracted, and Reuven acted according to their initial ruling:
If he was sitting in his house, it is a Safek [whether or not he must bring a Korban]. If he went abroad, he is exempt.
Ben Azai: What is the difference?
R. Akiva: Someone at home could have [asked and] heard if Beis Din retracted. A traveler was unable to.
4a (Rava): They argue about one was Machazik b'Derech;
Ben Azai obligates, for he is still inside his house;
R. Akiva exempts, for he is occupied with his journey, therefore he did not ask.
Rishonim
Rambam (Hilchos Berachos 10:25): When one wants to leave a city, he says "may it be Your will..."
Hagahos Maimoniyos: The Tur says that one concludes Baruch Atah Hash-m Shome'a Tefilah. One does not say it if he is already within a Parsah of his destination. Semag brought it just like the Rambam.
Question (Beis Yosef OC 110 DH veha'Rambam): Why didn't the Rambam mention the closing Berachah of Tefilas ha'Derech, or that the Shi'ur to say it is a Parsah?
Rosh (4:18): Some (Rashi) explain that the Shi'ur of Tefilas ha'Derech is a Parsah, i.e. one must say it within the first Parsah. This is considered heading on the road. Bahag explains that we say it only for a trip of at least a Parsah. This is primary. If he still has much to travel, why shouldn't he say it?! However, if one goes less than a Parsah, close to the city, this is not dangerous, so he does not bless.
Talmidei R. Yonah (Berachos 20a-b DH mi'Sha'ah): Bahag explains that we say Tefilas ha'Derech only for a trip of at least a Parsah. Some question this from the Yerushalmi, which says that all roads are b'Chezkas Sakanah. Perhaps this does not refer to close to the city, rather, on the road between villages. Some say that one must say it within the first Parsah. R. Yonah says that the proper Perush is that until a Parsah is considered starting on the way, but it does not mean that one does not request afterwards. As long as he must travel, there is danger! L'Chatchilah he should say it within a Parsah of leaving the city. If he forgot, he says it later, as long as he is still far from his destination. It is like we say about Tefilin. One blesses when putting them on, until tying them. I.e. from when he starts putting them on and onwards, when he wants, until tying. Surely if he forgot, he may bless after tying, since he did not yet remove them! As long as they are on, he fulfills the Mitzvah. Do not say that since he did not bless beforehand, this is not before the Mitzvah. (We bless on all Mitzvos beforehand.) Since he still does the Mitzvah, it is before the Mitzvah he will do [through continuing to wear them]! Likewise, if one did not bless before wrapping himself with Tzitzis, he may bless as long as they are on him.
Rashi (Horayos 4a DH Hichzik): The Tana'im argue about one who was Machazik b'Derech to go overseas, but he is still in the city.
Poskim
Shulchan Aruch (OC 110:6): When Maharam me'Rotenburg would travel, in the morning he would say Tefilas ha'Derech Samuch to Birkas ha'Gomel Chasadim.
Be'er Sheva (Teshuvah 45): Many say Tefilas ha'Derech in the house or Beis ha'Keneses after ha'Gomel Chasadim, even if they will not travel until after the Tefilah or even later. Surely one may not do so. Perhaps a reason will arise why he cannot travel, and he blessed l'Vatalah! We find that R. Yonah (Berachos 6a DH ucha'Yotzei) says not to bless on sleeping in a Sukah, lest he be unable to sleep, and he blessed l'Vatalah! These people misunderstood the Tur to mean that when Maharam would travel [even later in the day], in the morning he said Tefilas ha'Derech after ha'Gomel Chasadim. Really, it must be after leaving the city. When he would leave later in the day, in the morning he omitted one of the Birkos ha'Shachar, and said it when leaving the city, and afterwards Tefilas ha'Derech. One may not bless on the hand Tefilin until it is on the arm, even though he is ready to do the Mitzvah immediately. All the more so, one may not bless Tefilas ha'Derech until he is Machazik b'Derech. The Rambam says to say it after leaving the city, and no Poskim disagreed.
Magen Avraham (12): He says the Berachos on the road, for one may not say (Tefilas ha'Derech) until he begins traveling.
Mishnah Berurah (27): This was when he was forced to leave early, before Tefilah. When he left after praying, he could not say Tefilas ha'Derech before Tefilah, for one must start his journey first.
Note: Mishnah Berurah (52:2) lists only three Birkos ha'Shachar that one may not say after Tefilah if he did not say them beforehand. Ha'Gomel Chasadim is not among them. If so, why couldn't Maharam postpone saying this Berachah until after Tefilah, when he started traveling? (Piskei Teshuvos 46(86) says that Me'orer Yeshenim 18 forbids saying it after Tefilah.) Presumably Maharam preferred this Berachah because it ends with Baruch Atah Hash-m...
Shulchan Aruch (7): One says Tefilas ha'Derech only after he was Machazik b'Derech.
Magen Avraham (14): Machazik b'Derech means after he leaves the Ibur of the city, i.e. 70 Amos and a fraction outside. The Ibur of the city is like the city, like we say regarding vows (YD 230:1). Emek ha'Berachah explains that he left the Techum (2000 Amos) from the Ibur of the city.
Mishnah Berurah (29): We measure the 70 Amos after the last houses of the city. The Taz permits even in the city, once he resolved and is ready to go, but the Acharonim disagree. B'Di'eved, if one blessed then, he relies on the Taz. Once he started traveling, on future days we hold like the Taz.
Kaf ha'Chayim (49): Also, if he did not yet leave the city and its Ibur, perhaps he will reconsider and not go on the journey, and his Berachah was l'Vatalah.
Shulchan Aruch (ibid.): One says it only if he will travel at least a Parsah. For less than a Parsah, he closes without a Berachah.
Beis Yosef (DH v'Yesh): The Tur holds like the Rosh, that the primary Perush is of Bahag. For a trip less than a Parsah, he permits saying it without a Berachah. Also Kol Bo (87) says so.
Taz (6): Within a Parsah is considered to be still in the city.
Mishnah Berurah (30): Stam, less than a Parsah is not dangerous. If the place is established to be dangerous, one blesses Tefilas ha'Derech in any case, whether on a boat or the land. One who travels on a train must bless Tefilas ha'Derech even for only a Parsah. Therefore, he should bless once they begin traveling, like the Rema says. B'Di'eved, he may bless as long as there is still a Parsah to travel.
Shulchan Aruch (ibid.): L'Chatchilah, he says it in the first Parsah.
Taz (7): One should not delay saying it after a Parsah. One may say it even in the city, before going on the road. The Shulchan Aruch says that one must be Machazik b'Derech, i.e. totally sure that he will go. Some are particular not to say it until they leave the city, to the field. There is no source for this. Maharam used to say it in the morning on a day when he would travel. I say that those who say it outside the city do so in order to say it with others. The merit of Rabim (many doing a Mitzvah together) is preferable.
Gra (DH l'Chatchilah): L'Chatchilah, one should be concerned for Rashi's opinion.
Birkei Yosef (10): In Sha'ar Yosef (Horayos 4a), I showed that one may bless once he left his house to go, even if he is still in the city.
Sha'arei Teshuvah (9): Shevus Yakov (2:46) says that when leaving one's house he should not bless until he goes on the road, but if he is already in a lodging (e.g. hotel), he may say it before going (resuming his trip).
Aruch ha'Shulchan (13): Some say not to say Tefilas ha'Derech within the Ibur of the city, and some say not to say in the Techum. This is astounding. Some permit saying it once he prepared himself to leave (Taz). Also this is wrong. There is no proof from Horayos. There, it depends on distraction. Eruvin 52a proves that as long as he did not leave the house, he is not called Machazik b'Derech. Even a few steps out of the house is called Machazik b'Derech. Therefore, one may say Tefilas ha'Derech once he leaves his house.
Shulchan Aruch (ibid.): If he forgot, he says it later, as long as he is not within a Parsah of the city in which he will lodge. Past there, he says it without a Berachah.