-
I have provided an index.html file in my github pages site, however when I try to access it with a root url it throws a 404. When I add /index.html to the end it works perfectly. You can see this happening in the attached image .The repository running the github site is at https://github.com/NicksWorld/Codes-js-demo . |
Beta Was this translation helpful? Give feedback.
Replies: 18 comments 1 reply
-
Hmm, I can’t reproduce this - navigating to your website without index.html works fine. Can you try again now? And if still doesn’t work, what browser version are you using? |
Beta Was this translation helpful? Give feedback.
-
I already restructured the setup of the site, now it is all in the user site instead of project, and I use firefox. |
Beta Was this translation helpful? Give feedback.
-
I had this exact error, my index.html was just a plaintext:
Then I changed it to a proper HTML doc:
I commited the new changes and it worked fine now. |
Beta Was this translation helpful? Give feedback.
-
Hmm, I’m a new developer, but I have the same issue, however, everything mentioned above in terms of <!DOCTYPE html> was already implemented. I committed almost 21 hours ago and still nothing. With index.html at the end everything works. I see each product and can click into each product page. Without index.html products are missing and only one of the products (The 1st one) redirects to its product page. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot. It’s working as expected after this changes. Thanx. |
Beta Was this translation helpful? Give feedback.
-
Can you please elaborate the solution as I am facing same problem |
Beta Was this translation helpful? Give feedback.
-
I have added front matter part to the readme.md and it fixed the problem.
After this it shows index.html. 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/ |
Beta Was this translation helpful? Give feedback.
-
How can you tell us? |
Beta Was this translation helpful? Give feedback.
-
suffering from same problem how do i restructured the setups ? |
Beta Was this translation helpful? Give feedback.
-
I have the impression this is a workaround but not a solution. If you access your site via github.com, you want the content of readme.md displayed, so people know, what this project is about. If people access your website via github.io, you want the content of index.html displayed. I was under the impression, that the right way to do this, is to exclude README.md from your website by including in your _config.yml: exclude: - README.md Now the problems seems to be, that this is not always working as it should. |
Beta Was this translation helpful? Give feedback.
-
FWIW, for those (other) newbs out there, I found that if you have an existing repo, what they don’t mention in the GH Pages tutorial, is you just need to to go to settings in the repo, then scroll down to the Github Pages section, and then set the (master) branch (this is disabled by default), and save it. This should create a page you can then goto in the browser. EDIT: theme is optional - I left it off. See photos for visual guide. |
Beta Was this translation helpful? Give feedback.
-
thanks this worked great! |
Beta Was this translation helpful? Give feedback.
-
Thanks! This solved my problem! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the tip with the permalink. It worked right away. |
Beta Was this translation helpful? Give feedback.
-
I had the same problem and it was because I had an empty line before<!doctype html> in my index.html |
Beta Was this translation helpful? Give feedback.
-
Thanks Louvivien! That was my issue as well–never would have solved it without your tip. |
Beta Was this translation helpful? Give feedback.
-
I just had this exact same problem, but AFTER it was working It happened because I had to reset the gh-pages branch. So I
Then I had a script create an orphan branch gh-pages, populate it, and push it. Before this, everything worked without /index.html, but after, I had to add /index.html. I must have triggered a bug by accident. The fix was was go into the settings and change the GitHub Pages Source branch to master, then back to gh-pages. This toggle was able to get around the bugged state I found myself in and everything is good again. |
Beta Was this translation helpful? Give feedback.
-
This is not related to GitHub pages. Wordpress is not assosiated with GitHub pages or GitHub in any way, except for being open source. |
Beta Was this translation helpful? Give feedback.
I already restructured the setup of the site, now it is all in the user site instead of project, and I use firefox.