Use automatic redirect from www to root domain. As explained here: https://help.github.com/articles/setting-up-a-custom-domain-with-pages