Volcanism in continental rifts is generally observed to shift over time from the inside of the basin to its flanks and conversely, but the controls on these switches are still unclear. Here we use numerical simulations of dike propagation to test the hypothesis that the spatio-temporal evolution of rift volcanism is controlled by the crustal stresses produced during the development of the rift basin. We find that the progressive deepening of a rift is accompanied by a developing stress barrier under the basin, which deflects ascending dikes, causing an early shift of volcanism from the inside to the flanks. The intensification of the barrier due to further deepening of the basin promotes the formation of lower crustal sill-like structures that can stack under the rift, shallowing the depth of magma injection, eventually causing a late stage of in-rift axial volcanism.