简体   繁体   中英

Add Custom Domains in Github pages

How to change http://user.github.io/repo to http://customdomain.com/myrepo in github pages?

I tried to going through the documantation and but it didn't talk about this case.

AFAIK, to have a customized domain name, you have to create a file named CNAME in the root directory of your GitHub repository.
The file content should be something like this (this is just an example):

my-website.com

Instead of using https://user.github.io/<repo-name> , it will now redirect to my-website.com .
You still have to make a few other changes for this to work. Check out the GitHub Docs: https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site

I hope that helped. Let me know if you need any more help. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM