[thelist] IIS Virtual Directory Question

Joshua Olson joshua at alphashop.net
Tue Apr 17 15:47:26 CDT 2001


I set up a virtual directory on IIS (Win 2k, IIS 5.0) and had the following
difficulty:

I attempted to access the directory via http://www.mydomain.com/virtual
without an explicit filename at the end, and got a "Directory Listing
Denied" message from the server as opposed to the 404 page, even though I
had a default filename set up in IIS.  If I appended anything to the end,
say http://www.mydomain.com/virtual/garbage where "garbage" dos not exist as
a file or subfolder, I got the 404 error, I as expected

I needed it to give the 404 under both circumstances as I was using the 404
handler to direct traffic.

<tip type="ColdFusion/IIS - 404 Handler and Virtual Directories">
If you are using the 404 handler to make your sites search engine friendly
but also use virtual directories to segregate information, you may run into
the situation where IIS will assume you want to directory browse when you
append, to the URL, the name of the virtual directory, even though you want
the 404 handler to fire so that the application to run.

Add the to the root of the virtual directory a file of the same name as the
default filename for the directory and have that file contain a single
include to the primary file for the site (the same one the 404 handler
calls).  If the application.cfm file is above the target of the virtual
directory, you need not worry about explicitly cfincluding it.
</tip>

<rant purpose="?">
IMHO, using these tricks to basically rearrange how the web server is
intended to work has some nice results, but can lead to some serious
headaches and kludges.  Except for the fact that we (myself and others where
I work) have put so much effort into making it work, I'd almost be willing
to stop using it.
</rant>

If you don't know what I'm talking about, see:

<wrap>
http://lists.evolt.org/archive/Week-of-Mon-20010205/149988.html
</wrap>

-joshua





More information about the thelist mailing list