The Talmudic source of this halachah actually states “the tefach close to the street,” and this formula is quoted by many classical authorities. The Sages explain that this placement ensures that the entire house is protected from mazikin and that one sees it immediately upon entering the house. This would explain why many people follow this practice only on their outer doors.[1]
However, Shulchan Aruch and Rambam use the wording “tefach close to the outside.”[2] This could also imply that the mezuzah should be affixed to the “outside” tefach of each room. Because of this formulation, most contemporary authorities suggest that it is appropriate to apply this rule to internal doorways as well.[3]
[1] Divrei Yetziv Y.D. 191:2.
[2] Shulchan Aruch Y.D. 289:2; Rambam, Hilchos Sefer Torah 6:12.
[3] Minchas Elazar 2:6-7; Agur B’ohalecha 13:5. Sha’arei HaMezuzah (12:7) reports that this is the custom at present.