Redirect fixes. Trying to make secure request work with redirects.