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?


1 Answer 1


If the old sub domain now redirects to a new domain then you have already told Google the canonical version by doing so.

Google often takes several days and even weeks to drop a previous ranked site. The time can vary from site to site, from niche to niche. So, seeing both versions of the site is common and will resolve itself in time, Google does this intentionally to avoid webmasters losing sites from a temporary error with their site.

  • Simon is right. I have used github pages in past, and you're all subdomain pages is redirected to your custom domain, so Google will follow that destination URL and index it ASAP. To speed up process fast(when only few links point to you then), you can use change of address tool from Google search console, it might help you.
    – Goyllo
    Oct 18, 2016 at 4:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.