Changing the 404 Page not found page.

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.
 
P

Peter Bradley

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
 
C

clintonG

G

George Ter-Saakov

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top