Add httpS and redirect handling