0

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?

enter image description here

2
  • I just found google is indexing http:// www.website.com URL and not https:// website.com it's displaying in Google-selected canonical Commented Oct 16, 2023 at 4:03
  • Your redirect should point to the same URL as the canonical link (but that should be www.website.com rather than website.com)
    – symcbean
    Commented Oct 16, 2023 at 17:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.