Hugo

Custom 404 per language

I was using 404.html and 404.pt.html in /layouts/ to serve different pages when the server returned a 404 in the default language or Portuguese.

Looking at it today, both of the built files are the initial 404.html. Did something change in the way Hugo builds this page?

You have to find a way to config different 404 pages in your web server :frowning:
At best implement both languages in one page.

The server is working like intended, the problem here is that the page built in /404.html and /pt/404.html are the same.

with this hint

try with 404.pt.html

Yes, that’s my current setup and it was working.

Could it be connected to your earlier issue (that I can’t find now)? I remember we had a little back and forth about something related to PT.

I am pretty sure that /layouts/404.pt.html is supposed to be the 404 page for Portuguese and we have a bug here.

Does Hugo debug anything specific with hugo --i18n-warnings?

That one was about resources, but maybe it is connected with this one.

Just tried i18n-warnings and it built like expected, with no error.