Monday, December 22, 2003

TODO: really return 404 errors on "page not found"

On my company websites I have a script generate custom error messages in case pages cannot be found. This way, would someone be tampering with the site - and they do of course although mostly in a complete harmless way, thanks to our security measures - I would immediately be notified. This way, I at least know something is terribly wrong the moment it happens. The only problem is, to have IIS email you this way, you need a customized script (ASP) page which is called instead of the ordinary 404. I'm not able to place the script in the ordinary location for error messages. Therefore it resides somewhere in the IIS directories. Now, comes a spider along requesting for old outdated pages, it gets a "200 OK", and no 404, as the error page exists. I want to change this, so I figure I have to modify the script to have it automatically return a 404. I guess it doesn't take a lot of time - say: about the time writing this entry :) - the only problem is, it was one of many things on my TODO list. This morning arriving at work, I felt today would be the day. I'm going to solve this one :)