Biological communities often occur in spatially structured habitats where connectivity directly affects dispersal and metacommunity processes. Recent theoretical work suggests that dispersal constrained by the connectivity of specific habitat structures, such as dendrites like river networks, can explain observed features of biodiversity, but direct evidence is still lacking. We experimentally show that connectivity per se shapes diversity patterns in microcosm metacommunities at different levels. Local dispersal in isotropic lattice landscapes homogenizes local species richness and leads to pronounced spatial persistence. On the contrary, dispersal along dendritic landscapes leads to higher variability in local diversity and among-community composition. Although headwaters exhibit relatively lower species richness, they are crucial for the maintenance of regional biodiversity. Our results establish that spatially constrained dendritic connectivity is a key factor for community composition and population persistence.A major aim of community ecology is to identify processes that define large-scale biodiversity patterns (1-8). For simplified landscapes, often described geometrically by linear or lattice structures, a variety of local environmental factors have been brought forward as the elements creating and maintaining diversity among habitats (9-12). Many highly diverse landscapes, however, exhibit hierarchical spatial structures that are shaped by geomorphological processes and neither linear nor 2D environmental matrices may be appropriate to describe biodiversity of species living within dendritic ecosystems (13,14). Furthermore, in many environments intrinsic disturbance events contribute to spatiotemporal heterogeneity (14, 15). Riverine ecosystems, among the most diverse habitats on earth (16), represent an outstanding example of such mechanisms (7,(17)(18)(19).Here, we investigate the effects of directional dispersal imposed by the habitat-network structure on the biodiversity of metacommunities (MCs), by conducting a laboratory experiment using aquatic microcosms. Experiments were conducted in 36-well culture plates (Fig. 1), thus imposing by construction a metacommunity structure (20, 21): Each well hosted a local community (LC) within the whole landscape and dispersal occurred by periodic transfer of culture medium among connected LCs (22), following two different geometries (Materials and Methods, Fig. S1, and SI Materials and Methods). We compared spatially heterogeneous MCs following a river network (RN) geometry (Fig. 1D), with spatially homogeneous MCs, in which every LC has a 2D lattice of four nearest neighbors (2D) (Fig. 1E). The coarse-grained RN landscape is derived from a scheme (13) known to reproduce the scaling properties observed in real river systems (Fig. 1A).To single out the effects of connectivity, we deliberately avoided reproducing other geomorphic features of real river networks, such as the bias in downstream dispersal, the growing habitat capacity with accumulated contributing...