This fixes the way redirections are handled so that we do not redirect until we hit the redirection max and return a 500