set response headers and redirect