I have a website hosted using GitHub Pages, and have set up a custom domain according to the GitHub documentation (https://help.github.com/articles/using-a-custom-domain-with-github-pages/)
As a result, the website is accessible via two different URLs:
http://www.example.com
https://example.github.io
The former is considered canonical, and the latter immediately redirects to the former. However, when searching for my website via Google, the search results display the latter (https://example.github.io
) URL -- although clicking into this result immediately redirects to http://www.example.com
.
How can I inform Google that the canonical URL of this page is http://www.example.com
?