I know this is revival of a very old thread, but I have recently struggled with this as well and wanted to post the solution I found. In the IIS configuration for your site, there is a section for error pages. Change the 404 handling from file to URL, and give it a value of /PageNotFound.aspx. This places the following entries into web.config, at the bottom of the system.webServer section.
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/PageNotFound.aspx" responseMode="ExecuteURL" />
</httpErrors>
I really think this should be the default setting in the delivered mojoPortal web.Config. With this setting in place, all 404 conditions for the site will be handled and not passed to IIS and given a generic message.
Right now, mojoportal.com gives PageNotFound.aspx for http://www.mojoportal.com/blogs.aspx, but a server generic 404 message for: http://www.mojoportal.com/blogs.aspz, or http://www.mojoportal.com/blogs.html. Ideally, shouldn't these be handled the same way?