Project page serving from the wrong URL [SOLVED] #21840
-
When I go to my custom domain http://example.com, nothing appears. The network requests are attempting to fetch the static files from http://example.com/PROJECT_NAME/static/main.js, when they are actually located at http://example.com/static/main.js. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Solution: Setting package.json’s “homepage” field to “name.github.io” instead of “name.github.io/project_name”. Since DNS providers route to name.github.io for all (even multiple) projects, and uses CNAME to identify the project, the static files should be served from name.github.io, not name.github.io/project_name. |
Beta Was this translation helpful? Give feedback.
-
I need an explanation of this. What to edit in the package.json file. |
Beta Was this translation helpful? Give feedback.
Solution:
Setting package.json’s “homepage” field to “name.github.io” instead of “name.github.io/project_name”.
Since DNS providers route to name.github.io for all (even multiple) projects, and uses CNAME to identify the project, the static files should be served from name.github.io, not name.github.io/project_name.