I recently moved my website from HTTP to HTTPS. But when I try to get my HTTPS pages indexed, Google search console says "Duplicate, submitted URL not selected as canonical."
Google is preferring the HTTP version and indexing it but not the HTTPS. I tried adding user-declared canonical using the Yoast plugin but still, it is not getting indexed.
Should I redirect my entire website to HTTPS by editing the .htaccess file or is there any easier solution?