We study contests where the designers objective is an extension of the widely studied objective of maximizing the total output: The designer gets zero marginal utility from a players output if the output of the player is very low or very high. We model this using two objective functions: binary threshold, where a players contribution to the designers utility is 1 if her output is above a certain threshold, and 0 otherwise; and linear threshold, where a players contribution is linear if her output is between a lower and an upper threshold, and becomes constant below the lower and above the upper threshold. For both of these objectives, we study (1) rank-order allocation contests that use only the ranking of the players to assign prizes and (2) general contests that may use the numerical values of the players outputs to assign prizes. We characterize the optimal contests that maximize the designers objective and indicate techniques to efficiently compute them. We also prove that for the linear threshold objective, a contest that distributes the prize equally among a fixed number of top-ranked players offers a factor-2 approximation to the optimal rank-order allocation contest.