views:

72

answers:

1

We get notified of every error on our MVC2 web application. And we've receiving errors for controller path not found for files we know don't exist and therefore we believe are hacking attempts

System.Web.HttpException: The controller for path '/zencart/install.txt' was not found or does not implement IController.

What's the best way to avoid those errors to come up when people try to hack our website by trying to request files such as install.txt?

Thanks...

+1  A: 

You are already preventing them: a 404 error is sent instead of a the real file.

Darin Dimitrov
I don't get a 404. I get an exception.
Jonas Stawski
It's an HttpException with GetHttpCode() = 404. If you handle it properly you can send a personalized error page: `<customErrors mode="RemoteOnly" redirectMode="ResponseRewrite"><error statusCode="404" redirect="Views/Errors/Http404.aspx" /></customErrors>`.
Darin Dimitrov