如何停止重定向到自定义域?

How to stop redirecting to custom domain?

几年前,我从免费站点添加了一个自定义域,只是为了尝试 Github 的一项新功能。现在我想制作一个页面,我的主要 url 不断重定向到 myexpireddomain.com ...

http://myuser.github.io  => myexpireddomain.com
http://myuser.github.io/page  => myexpireddomain.com/page

这一切都会导致 404...因为域不存在。

我想我需要删除某处的 cname 文件。但是在我拥有的 20 个存储库中,我没有看到任何应该 cname 的存储库......哪个存储库位于根域。 http://myuser.github.io

您的主域的存储库是 myuser.github.io,如 documented on the Pages website, or possibly myuser.github.com in case your site is from before GitHub started using github.io for Pages

检查 master 分支,在存储库根目录中找到名为 CNAME 的文件。

为了删除自定义域,我删除了该特定网站设置中自定义域字段中的所有文本,然后按保存。然后,我发现你必须清除浏览器缓存(在google chrome我刚刚清除了最后一个小时的所有浏览数据),否则它仍然会重定向到自定义域!

此外,请确保已删除存储库中的 CNAME 文件。 Github 页面会在您添加自定义域时为您创建。