github不同项目pages使用不同的域名

github不同项目pages使用不同的域名

CNAME方式

最常见的是 CNAME方式: .github.io 或 .github.io

具体参考 https://docs.github.com/cn/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages

比如添加 www.example.com 指向 example.github.io在项目根目录 添加文件CNAME,

里面内容: www.example.com

之后的项目files的pages默认地址是www.example.com/files

默认方式

如果同一个GitHub账号上另一个项目比如files也开启一个pages

那么默认的访问路径是www.example.com/files

A方式

如果想把www.example.com/files 改成 file.example.com,可以通过A方式.

CNAME 文件对应一个域名, 比如file.example.com,

在域名里面A方式配置

img

效果

  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2020-2024 Lin