问题描述
在Github上使用github page搭建个人博客,在项目中的Settings->Pages
页面里面填写个人的域名时,出现如下报错信息,显示域名被占用情况
The custom domain
example.com
is already taken. If you are the owner of this domain, check out https://docs.github.com/pages/configuring-a-custom-domain-for-your-github-pages-site/verifying-your-custom-domain-for-github-pages for information about how to verify and release this domain.
问题产生的可能原因
可能是在上传博客的github上的时候,并没有包含域名的CNAME文件,然后上传之后,page页面里面的域名被刷新掉了。
还有可能就是在项目里面已经填写了域名,但是这个项目直接被删除掉了,想把这个域名添加到另外一个项目里面的时候,就可能会产生这样的问题
在github上也有其他人提出过这个问题:
https://github.community/t/the-cname-is-already-taken/149785
https://github.community/t/the-custom-domain-is-already-taken-except-its-not/215984
解决方式
在https://github.com/settings/pages
里验证这个域名的所有权。
在GitHub Support选择Help with a custom domain
。
描述自己的问题。
(对应步骤1) 说明自己已经验证该域名的所有权, 不然还会被要求验证一遍。
说明那个设置了自定义域名的、已经被你删掉的存储库的名称。
如果那个自定义域名不只被一个存储库使用, 那就把它们的名称都说明一下。
如无意外, 之后GitHub Support的工作人员会表示已解决问题:
回复
I’ve purged the data from your deleted repos.
Could you try and add your custom domain again? Let me know how it goes!
I’ll wait to hear back from you.
避免问题再次出现
稳妥的操作是: 先移除Pages的自定义域名, 之后删除存储库。