GitHub Pages: setting up custom domain

前端 未结 3 1466
太阳男子
太阳男子 2020-12-23 15:19

I\'ve got an organization page set up and running in GitHub and things seem to be working...but I\'m a little confused. I\'d like to actually understand the process since th

3条回答
  •  自闭症患者
    2020-12-23 16:12

    In order to take advantage of the CDN and DoS services provided by GitHub Pages, you'll need to set up a Subdomain (eg www.example.com or blog.example.com) instead of an Apex domain (example.com).

    From the GitHub Help page you referenced:

    If you are using an apex domain (example.com) instead of a subdomain (www.example.com) and your DNS provider does not support ALIAS records, then your only option is to use A records for your DNS. This will not give you the benefit of our Content Delivery Network.

    Here's a setup (looks like you're using GoDaddy for DNS) that would work to get your Organization Pages working as desired:

    DNS zone file on GoDaddy, set up for GitHub Pages

    This is actually for a Project Page within an Organization, but for either one, you'll set the CNAME record for www to organization.github.io, not something like organization.github.io/project. Don't change the A record for @ (mine is the default from GoDaddy).

    If you want to get your Apex domain (example.com) to redirect to the new subdomain (www.example.com), then you can point your Apex to your subdomain with Domain Forwarding like this:

    Domain Forwarding on GoDaddy

    With that setup, you'll get to take advantage of GitHub's CDN, which you may notice is provided through fastly. Here's how my domain looks to dig:

    Domain info for www.jekyllblog.com

提交回复
热议问题