I have redirected the www version and http version to non-www and https so the URL will be like https://website.com using the following .htaccess code:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Also I have written canonical tag like this:
<link rel="canonical" href="https://website.com/" />
(I don't know if I should do this or no.)
In google Search Console it's displaying "Duplicate, Google choose Different canonical than user" and not indexing my pages.
I tried updating the canonical URL and by removing it too. but still the problem is not solved. What should I do and what is the best way to do it? can anyone help me?