I have created a simple hook for a Liferay site I have. It contains a 404.jsp that overrides the default Liferay 404. It works fine if I type in a specific page. For example
I was still struggling to figure out how to do this until I read the section in the Liferay Developer's Guide about "Overriding a JSP". That told me exactly what I needed to know. Where the 404.jsp file should be stored in my hook, why there was a .portal.jsp file appearing in my liferay installation, etc. One other critical thing that was not mentioned was the addition required to the portal-ext.properties file. I had to add the following:
# 404 page
layout.show.http.status=true
layout.friendly.url.page.not.found=/errors/404.jsp
After a server restart, the 404 page started displaying for all incorrect pages.