How can I use a custom domain and the GitHub domain?

Hi all!
I want to create a GitHub pages for my project.
Because I have a custom domain, GitHub won’t let me publish under GitHub.io, but only on my custom domain.
How can I publish under GitHub.io?

Thanks!

simple don’t enable it at Settings, just simply enable GitHub Pages,

Can’t do that :frowning: It just automatically attached to my custom domain.

how come? it is not automatic, because the DNS record should be configured first, without the config even if you have a custom domain, it will not be redirected,

as you can see here, there are several steps to follow before you have your custom domain on GitHub Pages,

what you want to do to undo it is by removing it,

https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#removing-a-custom-domain

I don’t want to remove the custom domain - I use it for my blog.
I have another project which I don’t want to use this custom domain, but Github’s domain.

how about creating an org with just you as the member, that way, you can still publish that at github.io

say, liorp-tutorial that will be liorp-tutorial.github.io when published,

I think it could work, but I wouldn’t want to do that for every project I’m gonna create…

nope, you will still create repos at the org, you don’t need to create an org per project, say

liorp-tutorial.github.io/java-tutorial

liorp-tutorial.github.io/npm-personal-project

by creating repos at that org, it will automatically have that page when you turn on the GitHub Page per repo,

it is just like creating a new account that is not connected to your custom domain, but this time you achieve that using an org, so you can still use the default domain of GitHub

take a look at my example,

https://temptestfkdjfkdajf.github.io/README/

it’s an org and I enabled GitHub Pages, this way, I’m not even using my username, but it’s my org, but NOT under https://xdvrx1.github.io

You have a personal site repository (liorp.github.io, in your case) with a custom domain. In that case all your other GitHub Pages will be in subdirectories of that domain. If you move your blog to another repository name, the domain should only apply to it.

I’m a bit confused. I’ll provide my use case - I have my blog at liorp.github.io, which has a custom domain at blog.liorp.dev

I have another project react-hotkeys-docs-hook which I want to create GitHub Pages for. I don’t want it to be under blog.liorp.dev, I want it to be under liorp.github.io

How can I make it happen?

If the repository for your personal site (the one with the USERNAME.github.io name) has a custom domain, all your GitHub Pages sites will be under that domain, just like they’d otherwise be under the USERNAME.github.io domain (except ones with their own custom domains). You can’t change that.

What you could change is the repository of your blog. If you rename it (to something that isn’t the magic name for your user site), the custom domain will still apply to your blog, but not to all your other sites.