refs #2146 - ensures redirect does not break on api requests too