I have a github pages site, and I want to add it as a subdomain to my cloudflare domain without using a page rule
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.
CNAMEusing the drop-down options
- Add the sub domain in
- Add your unqiue GitHub username domain in
- Leave TTL as automatic and CloudFlare enabled, click
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.
- Finally click the Save button.
There is no need to enter a URL paths as the virtual host file hosted by GitHub will handle this part for you.