我在 GitHub 页面上部署了使用 (create-react-app) 创建的网站。
我有一个在 Github-pages 中添加的自定义 google 域
我添加了一个 CNAME 并按照所有说明进行操作
现在:1 - 如果我不使用自定义域,我可以访问我的网站,如果我去:https ://myAccount.github.io/MyWebsite/#/
2-如果我添加一个自定义域,Github 说一切都很好(见附图 1)
3- 添加自定义域并尝试访问我的新网站后,我收到以下错误:
main.12d12fef.css Failed to load resource: the server responded with a status of 404 (Not Found)
main.56dc6c7d.js Failed to load resource: the server responded with a status of 404 (Not Found)
4-如果我检查控制台(网络选项卡)有问题(我怀疑这是问题),请求的 URL 似乎错误(加倍):
http://www.MyWebsite.com/MyWebsite/static/js/main.89dc2c1d.js
5-这就是什么也没找到的原因 (404)
6-如果我删除 Double 并尝试访问:
http://www.MyWebsite.com/static/js/main.89dc2c1d.js
我可以看到缩小的代码
问题: 为什么请求的 URL 错误?为什么是双倍的?
http://www.MyWebsite.com/MyWebsite/static/js/main.89dc2c1d.js
我怎样才能解决这个问题 ?