: CloudFlare DNS: How to setup a GitHub Repository to a custom sub domain? I have a github pages site, and I want to add it as a subdomain to my cloudflare domain without using a page rule
I have a github pages site, and I want to add it as a subdomain to my cloudflare domain without using a page rule
More posts by @Jennifer507
1 Comments
Sorted by latest first Latest Oldest Best
This can easily be done by adding a few settings to CloudFlare and then later GitHub.
7 Steps on adding a subdomain to CloudFlare
Login to Cloudflare
Use the drop-down menu in the upper left of your screen and click your domain that you want the redirect to take place on.
Click the DNS icon at the top of the screen.
Select CNAME using the drop-down options
Add the sub domain in NAME
E.g my-project
Add your unqiue GitHub username domain in Domain name.
E.g your-gibhub-username.github.io
Leave TTL as automatic and CloudFlare enabled, click Add Record button.
5 Steps on setting up GitHub Pages to use your custom sub domain for your Repository
Login to GitHub.
Under 'Your repositories', select your Project.
On your Project Repository Toolbar find and click 'Settings'.
Scroll down to section 'GitHub Pages' and select the correct branch.
A new field will be enabled called Custom domain, simply add the sub domain to this field.
E.g my-project.example.com.
Finally click the Save button.
DONE!
There is no need to enter a URL paths as the virtual host file hosted by GitHub will handle this part for you.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.