The evolution of resistance to drugs is a major public health concern as it erodes the efficacy of our therapeutic arsenal against bacterial, viral, and fungal pathogens. Increasingly, it is recognized that the evolution of resistance involves genetic changes at more than one locus, both in cases where multiple changes are required to obtain high-level resistance, and where compensatory changes at secondary loci ameliorate the costs of resistance. Similarly, multiple loci are often involved in the evolution of multidrug resistance. There has been widespread interest recently in understanding the evolutionary consequences of multilocus resistance, with many empirical studies documenting extensive patterns of genetic interactions (i.e., epistasis) among the loci involved. Currently, however, there are few general theoretical results available that bridge the gap between classical multilocus population genetics and mathematical epidemiology. Here, such theory is developed to shed new light on these previous studies, and to provide further guidance on the type of data required to predict the evolution of pathogens in response to drug pressure. Our results reveal the importance of feedbacks between the epidemiological and evolutionary dynamics, and illustrate how these feedbacks can be exploited to control resistance. In particular, we show how interventions such as social distancing and isolation can influence rates of recombination, and how this then can slow the spread of multilocus resistance and increase the likelihood of reversion to drug sensitivity once drug therapy has ceased.