I have a folder on my server like this one:
C:\inetpub\wwwroot\blah
In IIS, I also have a "/blah" virtual folder set up, pointing to C:\BLAH
Naturally, when site visitors type in http://www.myserver.com/blah/test.html, IIS looks for C:\BLAH\test.html, not C:\inetpub\wwwroot\blah\test.html. For the most part, this is the behavior I want, because most of the files are in C:\BLAH. However, when the file DOES exist in C:\inetpub\wwwroot\blah, I'd like the server to look for it there first, and then look in C:\BLAH if it doesn't find it. Basically I'd like the files in C:\inetpub\wwwroot\blah to be an "exception" to the virtual directory. Have the server return the files from that folder, if they exist, but if they don't pull them from C:\BLAH instead of returning a 404.
I am running IIS 5.0 on Windows Server 2000.
Is this possible? Thanks.
This is kind of ghetto, but it might be a simple way to solve your problem.
Here is a little snippet of ASP.Net code that could act as the 404 handler:
You could probably do this through a custom written ISAPI filter, but I am not aware of any way within IIS or an existing product that would do exactly what you're looking for.
IIRF is a free URL Rewriter which has a capability to check for the existence of a directory, before rewriting. The rules would look like:
You can also wildcard "blah". To do that you'd need a convention for naming the override vdirs. It would look something like this:
There are also conditions for testing the existence of a directory. Check the IIRF doc for details.