Many organisms live in ephemeral habitats, making dispersal a vital element of life history. Here, we investigate how dispersal rate evolves in response to habitat persistence, mean habitat availability and landscape pattern. We show that dispersal rate is generally lowered by reduced habitat availability and by longer habitat persistence. However, for habitats that persist for an average of ten times the length of a generation, we show a clear non–monotonic relationship between habitat availability and dispersal rate. Some patterns of available habitat result in populations with dispersal polymorphisms. We explain these observations as a metapopulation effect, with the rate of evolution a function of both within–population and between–population selection pressures. Individuals in corridors evolve much lower dispersal rates than those in the mainland populations, especially within long, narrow corridors. We consider the implications of the results for conservation.