more modern way to choose http or https based on current page