Stopping epidemics when and where they occur