Recurrent bacterial infections are a significant burden worldwide, and prior history of infection is often a significant risk factor for developing new infections. For urinary tract infection (UTI), a history of two or more episodes is an independent risk factor for acute infection. However, mechanistic knowledge of UTI pathogenesis has come almost exclusively from studies in naive mice. Here we show that, in mice, an initial Escherichia coli UTI, whether chronic or self-limiting, leaves a long-lasting molecular imprint on the bladder tissue that alters the pathophysiology of subsequent infections, affecting host susceptibility and disease outcome. In bladders of previously infected versus non-infected, antibiotic-treated mice, we found (1) an altered transcriptome and defects in cell maturation, (2) a remodelled epithelium that confers resistance to intracellular bacterial colonization, and (3) changes to cyclooxygenase-2-dependent inflammation. Furthermore, in mice with a history of chronic UTI, cyclooxygenase-2-dependent inflammation allowed a variety of clinical E. coli isolates to circumvent intracellular colonization resistance and cause severe recurrent UTI, which could be prevented by cyclooxygenase-2 inhibition or vaccination. This work provides mechanistic insight into how a history of infection can impact the risk for developing recurrent infection and has implications for the development of therapeutics for recurrent UTI.