I’m trying to create a HTTP handler to handle all requests to a folder but I only want it to fire if the files requested don’t exist (EG: Request comes in for file X, if X exists I’d like to serve the file, otherwise the handler should deal with it).
The files will only be static content, not scripts themselves, which I assume makes it a bit easier but I can’t seem to find anything that will do the trick… Anyone have any ideas? I assume it can be done since the IIS7 rewrite module can manage it, but I can’t see how…
Edit Just to clarify… the handler is the typical case and it is not an error-handling routine but actually delivering appropriate content. I just want the ability to add new files to the folder either as separate things or as overloads to what the handler would deliver.
I’ve ended up sticking with a handler and instead using the following to solve the problem:
Given so many people advocated Modules and catching exceptions I feel I should clarify why I didn’t listen: