I have a splash page hosted in github pages for a client while we finish their official site.
Until a few days everything was ok but I now realized that google is indexing the github url instead of the custom domain.
I followed github instructions, i used the CNAME file in my repo, I setup the A domain for the top-level domain and the CNAME for the www. I looked all over the internet without luck. I tried using google webmaster tools, and I can't really use robots.txt because that would affect both.
I think I found the solution. Leaving it since it might be helpful to others.
I need to wait now for google to re-index, but it should do it. According to this question and this google article a canonical link tag in the head should fix it.
<link rel="canonical" href="http://www.[website-url]"/>
I also added a js redirect trick to redirect the people coming from google.
if ( window.self === window.top ) {
// console.log("not in a frame")
window.location.href = 'http://www.[website-url]';
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With