404 error on a href link?

I don’t know what’s happening, but when I run my site locally everything looks ok, however when I push to github pages I keep getting a 404. I am using relative paths and am confused because I’m doing the same thing for multiple pages.

I.e. I have a /booknotes folder that works fine.
and I have a /blog folder where everything seems to break.

It’s like the relative link doesn’t work just for that folder. But It’s all fine locally.

Here is where my code is hosted: GitHub - vishnukmurthy/vishnukmurthy.github.io

it’s working now, have you checked it? I just checked it now,

when you update or build something, it will take time, maybe 5-10 minutes

hmm, no it’s still broken. Maybe I should be more clear about my issue.
If I click the “blog” tab, , and then click any of the blog posts you will see a 404.
However, if you click the “book notes” tab, and then click on a book note everything works.

The code is structured similarly. I.e. blog is a folder and book notes is a folder, and the posts are within that folder. References to both are done as absolute paths.

the crime and punishment in booknotes folder is working, meaning, your blog.html at the main folder is causing the issue, clashing with blog folder. You can simply put an s so that it will be a different word.

1 Like

First off, thanks for the help! I really appreciate it. This fixed my issue!

I do have a few follow up questions that I hope you wouldn’t mind taking the time to answer though.

  1. I had a booknotes.html and a /booknotes folder. Why did the issue only happen for blog.html and /blog and not for the booknotes equivalent? The logic seems the same so I imagine the issue should persist? The only difference is booknotes has only one file in the directory while the blog folder has multiple.

  2. Is this a bug? I see these tickets that have been ‘frozen due to age’
    If `bar.html` exists, then `jekyll s` will show `bar.html` for `bar/.*` unless something else explicitly (but not implicitly) overrides it · Issue #6475 · jekyll/jekyll · GitHub
    `jekyll s` redirects to slightly wrong URL (with file and folder of same name) · Issue #6459 · jekyll/jekyll · GitHub
    My ruby game is weak, but I think it would make sense for me to try and help fix the issue if possible haha.

Thanks again for all your help.

1 Like

this is tricky, you are using some kind of template


that’s the page when it’s just blog but when you have the complete,


this is your site

and the last one to take note of


when you put /, it is 404

Ah. I think I know what the problem is. Github Pages - where my website is being hosted runs Jekyll on the backend behind the scenes. It looks like /blog/ has special meaning in Jekyll and things get funky if I name a folder that.

1 Like

yup, but I’m not so sure of all the details of your page, I’m just observing it from the external

appreciate the help. Anyway that I can mark your answer as a solution, or give you official credit via github? This is my first time using this board.

1 Like

yup, no problem with that, thanks, just mark it as a solution

1 Like

any chance you could tell me how to do that? I don’t see any intuitive way, all I see is like and flag as options :confused:

if you place your cursor to the Solution then click it, that’s it, at the bottom, near the reaction button

Hi @vishnukmurthy! It looks like you couldn’t mark this as solved because it wasn’t inside a category. I’ve moved this thread to the GitHub Pages category now and marked @xdvrx1’s response as the solution for you :sparkles:

1 Like

thanks @thomasshaped and @vishnukmurthy

1 Like