- 1. Solution
- 2. Post scriptum
I started working on one small Django project and after creating a Minimum Viable Product , I launched it immediately into the online space so that it would start to be indexed by search engines.
Thus, I expect that at the initial stage I will be able to quickly correct indexing errors and immediately improve the site.
So when I saw this post from Google Search Console today:
> The page is a copy. The canonical variant was not selected by the user.
Essentially, the problem from Google Search Console's point of view is that the site is accessible both with and without the www address.
Solution
To begin with, I decided to fix this in the most rude way, namely, add a canonical link to the required page without www in the head tag. The disadvantage of this solution, I think, is that the canonical link will also be present on the page that is canonical. I did not find information that this is not allowed, so I do not know how search engines will perceive this. So I'll just see what the result of the check will be.
The code itself looks like this now
<link rel="canonical" href="https://example.com{{ request.path }}">
Post scriptum
Recently, I have had a lot of thoughts and ideas for a variety of articles, but I just physically do not have time to deal with all areas. And then Diablo IV and Baldur's Gate III came out... In general, complete darkness in the time management.
Therefore, I will simply write notes that will not always look like articles, but will contain bits of useful information.