Custom Domain for Project Pages in GitHub

GitHub is social coding website where we can host, collaborate with others on our code. About a month ago, I’ve made a repository to host the CDN of in GitHub. But on the first try, I can’t get it working. So I’ve written an email to GitHub Support. And they’ve answered quickly and it has just solved my problem.
Custom Domain for Project Pages in GitHub

Why should you host CDN or a website in GitHub?

  • GitHub is totally free if you would like to host your website/sub-domain publicly. Yeah, It costs if you want to make private repositories. Now, GitHub provides unlimited private repositories.
  • GitHub Support is awesome. They’re quick in giving response.
  • It supports Jekyll. Which is static site generator. (Many bloggers host their blogs on GitHub.)
  • We can also host One Page Website by just adding index.html and some stylesheets, images, etc.
  • It works based on git which is a version control system so we can also see our previous version of the website, make new branches, people can submit pull requests, etc.
Note: There isn’t support for a language like php. Also GitHub doesn’t provide any analytics for your hosted site/CDN.
How to configure a Custom domain for project pages in GitHub?
  1. First of all make a new repository in GitHub of your choice like if you want to host CDN of then you should name repository
  2. Clone it in your desktop via GitHub app… or whatever application you used to clone repositories from GitHub.
  3. Then delete the branch master if it’s there (It’s there if you checked Initialize this repository with a README and/or added .gitignore and/or added license file), and then just make a new branch called gh-pages.
  4. Then add your content there like index.html, style.css, images, etc.
  5. Then add CNAME which is used to set up a sub-domain with Github, in CNAME write your sub-domain name like
  6. Commit and Push it to GitHub.
  7. Go to your Domain Control Panel (where you’ve purchased your domain) and go to the domain’s CNAME Records.
  8. Add a CNAME record with hostname like here and in the value field type (username will be your username of GitHub/organization username of GitHub.)
  9. Then click Submit/Add Record.

Now wait for some minutes (approximately 10 minutes) and your sub-domain will be hosted in GitHub. If you face any issues while configuring this, you can email to GitHub Support or you can fill this form.

Thank you very much for your precious time. If you enjoyed reading this article, kindly share this with your friends.

Spread the word:


Related Posts

Leave A Reply

Please enter your comment!
Please enter your name here

two × four =

Spread the word: