Reputation: 245
I have problem with host my react project on gh-pages. i Have my repo on github ----> GitHub repo My page return readme file instead of indx.html (public/index.html). ---> My Page
What should i do to my page with my react app works correctly?
Upvotes: 5
Views: 18521
Reputation: 334
In my experience, it was simply a latency issue. When I initially committed index.html (in the root of the repo), myorg.github.io continued to serve README.md. After a few hours, I returned and tried it again - lo and behold my index.html was served. Because of the time I was away, I can't make a guess about how long it takes github pages to update.
Upvotes: 10
Reputation: 1401
I have added front matter part to the readme.md and it fixed the problem.
---
permalink: /index.html
---
After this it shows index.html instead of readme. I have found this solution also helps for custom 404 pages. https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/
Upvotes: 6
Reputation: 2867
Yes, the problem is in how you have deployed your site, you should deploy your target index.html to gh-pages Check this out:
It gives a detailed and pretty good explanation on how to deploy react application to github pages.
Upvotes: 2