Twisted two-dimensional bilayer materials exhibit many exotic electronic phenomena. Manipulating the 'twist angle' between the two layers enables fine control of the electronic band structure, resulting in magic-angle flat-band superconductivity1,2, the formation of moiré excitons3-8 and interlayer magnetism9. However, there are limited demonstrations of such concepts for photons. Here we show how analogous principles, combined with extreme anisotropy, enable control and manipulation of the photonic dispersion of phonon polaritons in van der Waals bilayers. We experimentally observe tunable topological transitions from open (hyperbolic) to closed (elliptical) dispersion contours in bilayers of α-phase molybdenum trioxide (α-MoO3), arising when the rotation between the layers is at a photonic magic twist angle. These transitions are induced by polariton hybridization and are controlled by a topological quantity. At the transitions the bilayer dispersion flattens, exhibiting low-loss tunable polariton canalization and diffractionless propagation with a resolution of less than λ0/40, where λ0 is the free-space wavelength. Our findings extend twistronics10 and moiré physics to nanophotonics and polaritonics, with potential applications in nanoimaging, nanoscale light propagation, energy transfer and quantum physics.