HUGO

Get customised 404 file to be displayed on your (UK2) website

I have a static website built with Hugo and hosted by UK2. My website uses the ‘Hello Friend’ Theme (by panr), which includes a helpful 404.html file that reuses my site’s header/footer for consistency. However, this 404.html file was not being accessed if and when a user navigated to a page that did not exist on my site. A general 404 error message was being displayed instead. I found the solution was to change the 404.html filename to 404.shtml on my UK2 domain server. I have no idea if this will work with website hosting service providers other than UK2 but I hope this tip may help someone out there!