Changing the 404 Page not found page.

  • Thread starter Thread starter JB
  • Start date Start date
J

JB

I have found where I can change the page that is displayed for 404 in IIS.
Question is - can I use an aspx page? I want to have the page send me an
e-mail of the URL of the page they are trying to access. The main site is a
..Net 2.site.

TIA - Jeff.
 
I doubt it. Since 404 means the document was not found, it's never going to
enter an application.

I've been wrong before, though.

Inside your application you should trap every error - which means you'll
need something in Global.asax to mop up everything you might have missed in
your try{} blocks.


Peter
 
You can.

But should warn you. If it's an Internet application that might be bad idea.
There are many crazy robots walking out there that hits your website with
some random URLs.
You will get a lot of emails.

It's much better if you have some kind of analyzing software that analyzes
logs of your webserver. To check for 404 errors.

But nevertheless custom 404 is nice. Just do not forget to set correct
return code 404. with Response.StatusCode = 404; (i am just using my memory
here, check MSDN)
Otherwise ASP.NET will send 200 wich means evetrything is OK. Thus messing
up your IIS logs.


George.
 
Back
Top