If you're using a custom domain to redirect your GitHub Pages site, you must create and commit aCNAME file to your GitHub Pages repository that contains the custom domain.

  1. On GitHub, navigate to your Pages repository.
  2. In the "Branches" menu, switch to your repository's Pages branch:
    • For User and Organization Pages sites, the Pages branch is master.
    • For Project Pages sites, the Pages branch is gh-pages.
  3. Add a new file, named CNAME (with all caps!), to the root directory of the Pages branch.
  4. In the new file, add a single line that specifies the bare subdomain for your custom domain. For example, use blog.example.comnot https://blog.example.com. Note that there can only be one domain in the CNAME file.
  5. Type a commit message, or accept the default message.
  6. Under the commit message box, click Confirm merge.

----------