How can I disable GitLab Pages default domain when using a custom one?

Hello.

When using a custom domain for GitLab Pages, it seems that default domain (*.gitlab.io) is also active, so content is published in both domains at once.

How can I disable default domain? If there is an option, I can’t find it.

Thanks in advance. Kind regards.

As you are using Gitlab.com then that is not possible. This link explains more: GitLab Pages custom domains | GitLab

In particular:

The site has to be deployed to the default gitlab.io domain. Also you will see on that same page but this section: GitLab Pages custom domains | GitLab that the DNS relies on a CNAME entry for your custom domain to point to your gitlab.io domain that Gitlab pages is using. Therefore it has to exist and be active, else your custom domain won’t work.

Is GitLab Pages DNS implemented significantly differently from Github pages in this regard? I have my personal tech blog hosted through Github pages, and if one were to try to go to my blog through its default jyscao.github.io URL, Github would automatically redirect it to my custom domain at https://jyscao.xyz

Is something like this not possible for GitLab Pages?