All known methods for transverse confinement and guidance of light rely on modification of the refractive index, that is, on the scalar properties of electromagnetic radiation. Here, we disclose the concept of a dielectric waveguide that exploits vectorial spin–orbit interactions of light and the resulting geometric phases. The approach relies on the use of anisotropic media with an optic axis that lies orthogonal to the propagation direction but is spatially modulated, so that the refractive index remains constant everywhere. A spin-controlled cumulative phase distortion is imposed on the beam, balancing diffraction for a specific polarization. As well as theoretical analysis, we present an experimental demonstration of the guidance using a series of discrete geometric-phase lenses made from liquid crystal. Our findings show that geometric phases may determine the optical guiding behaviour well beyond a Rayleigh length, paving the way to a new class of photonic devices. The concept is applicable to the whole electromagnetic spectrum.