Redirecting request for non .page files to the InvalidSite.jsp is the default behaviour. You could modify the /runtime/web/iw/errors/InvalidSite.jsp to either redirect to an existing custom 404 page or modify it directly.