LogoLogo
HomeGitHub
v0
v0
  • 🏃‍♂️Getting started!
  • 📝Filling up your page
  • 🌐Custom domain name
  • 📣Favicon and Meta Tags
  • 🔡Custom fonts
  • 🛤️Adding more pages
  • 🎨Theme customization
  • 🎇Restyling components
Powered by GitBook
On this page

Custom domain name

PreviousFilling up your pageNextFavicon and Meta Tags

Last updated 2 years ago

Let's say you own the domain name: yourdomain.com.

  • If you want poeple to hit your landing page when they query https://yourdomain.com or https://www.yourdomain.com ,follow the instruction of the Apex domain tab.

  • if you want people to hit your landing page when they query https://asubdomain.yourdomain.com, follow the instructions of the Subdomain tab.

Create theses DNS records (don't forget to replace yourUsername by your GitHub username and yourdomain.com by your domain):

www.yourdomain.com. CNAME yourUsername.github.io
yourdomain.com.     ALIAS yourUsername.github.io

If, and only if, your DNS service provider do not support ALIAS records:

 www.yourdomain.com. CNAME yourUsername.github.io
-yourdomain.com.     ALIAS yourUsername.github.com
+yourdomain.com.    A     185.199.108.153
+yourdomain.com.    A     185.199.109.153
+yourdomain.com.    A     185.199.110.153
+yourdomain.com.    A     185.199.111.153

Once your DNS records are available, update your package.json homepage field:

-"homepage": "https://yourUsername.github.io/yourRepoName",
+"homepage": "https://www.yourdomain.com",

of your CI workflow will make sure GitHub Pages understands the change.

Create theses DNS records (don't forget to replace yourUsername by your GitHub username and yourdomain.com by your domain):

asubdomain.yourdomain.com. CNAME yourUsername.github.io

Once your DNS records are available, update your package.json homepage field:

-"homepage": "https://yourUsername.github.io/yourRepoName",
+"homepage": "https://asubdomain.yourdomain.com",

of your CI workflow will make sure GitHub Pages understands the change.

Commit and push your changes and your are good to go.

You do not need to go to the GitHub Pages config and fill in your custom domain, it will be read from the CNAME file.

🌐
This line
This line