-
Notifications
You must be signed in to change notification settings - Fork 183
Custom Domain
Questions: How do I set a custom domain?
GitHub Pages and Moonrise make using your own domain fast and easy.
A domain name is usually not free, but they are very cheap (some less than $1 USD/month).
Here are some recommended registrars:
DO NOT use GoDaddy. They are expensive and bad. You will regret it.
Do not go for "free domains" like .tk
. They often come with bad terms, such as being able to take down your site anytime, force you to pay big $$$$$ to keep using it after a year, or inject ads into your site.
Next, you need to direct GitHub Pages (which is hosting Moonrise) to point to the custom domain name you own.
Follow this guide to make sure your DNS settings and GitHub repo settings are set up properly.
To make things easier, here's a video:
In Moonrise's _config.yml
file, these are the first 5 lines:
# Set this website's info
# Change "coffeebank" to your GitHub username
# Change "moonrise" to your repository name
url: "https://coffeebank.github.io"
baseurl: "/moonrise"
The way this code works is that there is a domain (url) setting, and a folderpath (baseurl) setting, for if you want to host Moonrise on a https://domain.com/folderpath
formatted domain.
To host it on your own domain.com
itself, change the settings to as follows:
url: "https://yourcustomdomain.com"
baseurl: ""
Make sure that the "url" field does NOT have a / at the end.
Replace yourcustomdomain
with your custom domain.