It makes better the compliance with HSTS, http to https redirect must be done before domain to www.domain.