Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I stop a github project page (or other subpage) from showing custom domain name?

Tags:

github

dns

cname

I'm using GitHub pages to host my blog. I've set up a CNAME record in the repository and added an A record and CNAME record to my domain registrar (123-reg). This is working fine so now my personal page donskifarrell.github.com -> donalfarrell.com.

This also makes all my project pages map to the same new domain, eg. donskifarrell.github.com/calex -> donalfarrell.com/calex.

While this is quite nice to have, it is proving to be troublesome for one of my projects.

Is there any way to modify my setup so that certain project pages do not use my own custom domain and instead retain the github url?

Thanks

like image 307
Donal Avatar asked Aug 23 '12 11:08

Donal


People also ask

How do I remove a custom domain from GitHub?

Removing a custom domainOn GitHub, navigate to your site's repository. Under your repository name, click Settings. In the "Code and automation" section of the sidebar, click Pages. Under "Custom domain," click Remove.

Does GitHub Pages support custom domain?

You can customize the domain name of your GitHub Pages site. GitHub Pages is available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.

How do I redirect a custom domain to GitHub?

Go to your GitHub Pages repo, click Settings and below GitHub Pages, under Custom domain, enter your custom domain and click Save.


1 Answers

There isn't really a way to prevent the redirect from happening.

However, if it will help to have that project at a different domain or a subdomain, you can use a CNAME file in the project's gh-pages branch to override your user redirect with a project-specific one.

See more info at the bottom of: https://help.github.com/articles/user-organization-and-project-pages

like image 186
Moshe Katz Avatar answered Oct 19 '22 10:10

Moshe Katz