Use output buffering so that we have a chance to redirect