Custom domain for your website
Published:
You may think that yourname.github.io
is not cool enough compared with yourname.com
. No worries, we can change the domain.
NOte: the following steps could also be found on official documentation
- Buy your prefered domain. I bought it from namecheap. I strongly recommend you to also buy the SSL which can make your website more safe by starting with
https
instead ofhttp
. Some browsers will alear unsafe if your website starts withhttp
. - After you bought your domain, you can go to the setting of you repository
username.github.io
, clickCode and automation
->Pages
->Custom domain
-> enterwww.yourname.com
->Save
. - Set DNS. Go to your domain provider website namecheap, for example. Go to
Dashboard
->manage
->Advanced DNS
, set DNS like the following figure. The IP address in the following screenshot is the IP address of github servers. You can also copy them from the official documentation Then you need to wait for several hours to 24 hours. You can check the DNS status on
setting
of your repository. It looks like the followinig figures. If it showsunsuccessful
, you can try again.Set SSL.
SSL can change your domain from
http
tohttps
, so that browser would think your website becomeSafe
. Otherwise, your website would look like:So how to set SSL?
`At first you need to buy it from your domain provider. After that you need to install and activate it.`DO NOT BUY SSL! Because Github itself provides very simple method to achieve it. Just go to thesetting
of your repositoryusername.github.io
, clickCode and automation
->Pages
-> CheckEnforce HTTPS
. You may need to wait for several minutes to observe its influence, and you may see the layout of the whole website broke down during these minites. You can try another browser, or clear the browser cache (e.g. Chrome incognito) and try to visit the website again. Please be patient and you will see the perfect performance finally.
Leave a Comment