gpt4 book ai didi

jekyll - index.html 以外的默认文件

转载 作者:行者123 更新时间:2023-12-05 01:47:31 24 4
gpt4 key购买 nike

有没有办法让 index.html 或 index.md 以外的文件作为文件夹的默认文件?具体来说,我希望保留我的 .json 文件扩展名,但将其作为/api-docs/myapi/而不是/api-docs/myapi/myapi.json 进行引用。

最佳答案

此配置主要在您的网络服务器中。您可以将服务器要查找的文件设置为 index.json(以及常见的 index.htmlindex.htm在大多数服务器上)。例如,这可以通过将其添加到您的服务器 block 来在 nginx 上进行配置:

index index.json index.html index.htm;

如果 nginx 收到对 /some/folder 的请求,它将尝试提供 /some/folder/index.json, /some/folder/index.html, /some/folder/index.htm 然后你的 404 页面有这个配置。

关于jekyll - index.html 以外的默认文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25457343/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com