PDA

View Full Version : IIS on localhost and getting paths right


Spudhead
04-19-2006, 12:00 PM
I really should understand this. But I don't. Can anyone gently nudge me towards a basic grasp?

So; my desktop dev machine. XP Pro running IIS 5.1.

I've got a load of dev sites all dumped in various folders under wwwroot. Let's say, for example, "C:\Inetpub\wwwroot\myDevSite"

I go into IIS and, under "Default Web Site", create a new virtual directory that points at the above... err... "real" directory. Let's give it an application name, "DevSite1".

So, I go to http://localhost/DevSite1 and there's my site. Woohoo. It's got a global.asa in the "myDevSite" folder which is being parsed correctly, so the thing is definitely running as an application, or a virtual dir, or whatever you want to call it.

Now, let's say I put a file in the myDevSite folder containing the following: <a href="/dir/file.html">link</a>. My understanding was that prefixing URL's with a forward slash meant "go from the root" - but I appear to be mistaken about what the "root" actually is. In the example above, I'd expect that to look for C:\Inetpub\wwwroot\myDevSite\dir\file.html, but actually it looks for C:\Inetpub\wwwroot\dir\file.html. This is not good. I don't understand. Please help me :(

Spudhead
04-19-2006, 05:17 PM
Nobody? Fourteen views and no replies? Don't get me wrong, I'm not bemoaning a lack of effort, I'm just surprised that this wasn't a simple answer for anyone. Am I the only person this has ever happened to?

oracleguy
04-19-2006, 06:49 PM
That isn't the way virtual directories work. If you wanted that link functionality you'd need to create a new site -- something you can't do in the IIS in XP Pro. Because you are you only allowed one.