【问题标题】:Options for changing the directory index when using GitHub Pages使用 GitHub Pages 时更改目录索引的选项
【发布时间】:2016-09-01 23:19:09
【问题描述】:

我正在使用 GitHub Pages 来托管一个网站,我想将我的 index.html 文件重命名为其他名称(例如 home.html)。问题在于 GitHub 专门查找并加载默认的“index.html”作为目录索引。

我了解可以通过服务器配置文件(例如 .htaccess)更改目录索引,但 GitHub Pages 不支持这些。

我环顾四周没有运气,所以我想看看是否有任何选项可以更改“index.html”文件的名称以尝试“美化”链接回我的主页。

更新:与使用重定向相比,我更愿意实际更改 GitHub 正在寻找的目录索引文件的名称。

【问题讨论】:

    标签: .htaccess github webserver web-hosting github-pages


    【解决方案1】:

    一种可能性是添加从index.html 页面到新home.html 的重定向。

    因此,index.thml 页面仍然存在,但几乎是空的。
    请参阅“Redirect from an HTML page?”或“What is the best approach for redirection of old pages?”。

    <meta http-equiv="refresh" content="0; url=home.html" />
    

    【讨论】:

    • 谢谢!不过,我想看看是否有一些选项实际上可以让我更改索引与执行重定向。我更新了我的问题以包含此内容。
    • @willascend 我建议重定向,因为我不知道这样的选项,所以我想看看是否也有。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-11
    • 2017-02-09
    • 1970-01-01
    • 2013-12-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多