Add this to the System Webserver section in the web.config file to handle any non .aspx pages
<system.webServer>
<httpErrors errorMode="Custom">
<remove statusCode="404" subStatusCode="-1" />
<error path="/" prefixLanguageFilePath="" responseMode="ExecuteURL" statusCode="404" />
</httpErrors>
</system.webServer>
Just keep in mind that the Error Path section can be set to whatever file you require the error to be redirected to.
Example:
error path="/"
Or
error path="/errorpage.htm"
Or
error path="/404.aspx"
etc etc.
- 5 Users Found This Useful