If your server is Apache you can setup an .htaccess file and build rules to hide/redirect and return a 404 Error page.
If your server is IIS then you can modify the "URL Rewrite" rules in your IIS Manager to return a 404 Error/Forbidden page.
See: .htaccess tips & tricks