Getting 404 for posts with articles whose name is written in uppercase

I’ve been encountering a 404 error on GitHub Pages when trying to access a new post with the name in uppercase (CVE-2023-2317).

I’ve read a similar situation on this post: hugo-site-returning-404-not-found-for-new-posts, GitHub allocated my post as CVE-2023-2317 with the URL cve-2023-2317, but it actually placed it in the uppercase version of the directory. In other words, Hugo generated my post under /posts/CVE-2023-2317/, but when I try to access the post from /posts/, Hugo redirects me to /posts/cve-2023-2317/ instead.

I’ve attempted to regenerate posts with disablePathToLower = true. Everything works fine when I run hugo server -D on my local machine, but I still get a 404 error after deploying it to GitHub using GitHub workflows. How can I resolve this issue, please?

My repository:

My article:

Sorry, but I don’t understand the problem.

If you do this:

hugo new

Your content directory will look like this:


When you publish your site it will look like this:

├── cve-2023-2317/
│   └── index.html
├── favicon.ico
└── index.html

If you want to retain uppercase letters in your published site, set disablePathToLower = true in the root of your hugo.toml file, not under the params key.

1 Like

Now I see where my problem is. As you said I set disablePathToLower outside the params key and everything works fine now. Thank you for your great help! :heart:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.