juha
juha
CDCloudflare Developers
Created by juha on 9/6/2024 in #pages-help
404.html Files in Subdirectories Not Used
I have a multilingual Hugo website on Cloudflare Pages. I have a 404.html file at the root and a localized version under each lang subdirectory (ie. /en/404.html, /de/404.html and so forth). The documentation says:
Pages will then attempt to find the closest 404 page. If one is not found in the same directory as the route you are currently requesting, it will continue to look up the directory tree for a matching 404.html file, ending in /404.html.
This implies that if the URL is something like example.com/de/foobar, it should use the 404.html under the /de/ directory. However, it looks like the 404.html at the root is always used. Have I misunderstood something, or is this functionality broken?
9 replies