【问题标题】:How do I remove GitHub pages sub-domain redirection?如何删除 GitHub 页面子域重定向?
【发布时间】:2018-08-29 00:59:17
【问题描述】:

我有一个 Namecheap 域名,它是 somedomain.example。我不小心将博客存储库中的somedomain.example/blog/ 更改为blog.somedomain.example。现在,即使我删除了我的 CNAME 记录并从 GitHub 页面设置中的设置中删除了自定义 URL,我的 somedomain.example/blog/ 仍然被重定向到 blog.somedomain.example

有没有什么办法可以去掉这个重定向并按原来的方式使用它?

P.S 现在我的 gh-pages 存储库中没有 CNAME。

【问题讨论】:

    标签: github subdomain url-redirection github-pages namecheap


    【解决方案1】:

    我也有类似的问题。 就我而言,我只有分支:gh-pages(例如 repo.github.io);

    git branch -> * gh-pages
    

    对我有用的是创建分支master;

    git branch master ->
    git branch -> gh-pages, * master
    git push origin master
    

    (其实我觉得是个把戏)

    只需确认gh-pages 中没有NO CNAME 文件,主要在master 分支中。

    https://github.com/username/repo.github.io/blob/master/CNAME -> 404
    https://github.com/username/repo.github.io/blob/gh-pages/CNAME -> 404
    

    你可以通过cURLonline测试你是否还在重定向;

    e.g. http://redirectcheck.com/index.php
    

    我希望这对你也有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 2013-03-17
      • 1970-01-01
      • 2015-04-18
      • 1970-01-01
      • 2021-08-08
      • 1970-01-01
      相关资源
      最近更新 更多