views:

30

answers:

3

I set up a Virtual Directory called 'Site'. I browse to http://localhost/Site/default.aspx, and it loads. However, when I click on anything on the page, say Page1.aspx, it goes to http://localhost/Page1.aspx instead of the expected http://localhost/Site/Page1.aspx.

In the source file, the relative paths are coded as '/Page1.aspx', for example, and it has worked in the past.

I'm using Win XP Pro SP3 and IIS 5.1. Any ideas on what might be causing this behavior?

A: 

Try converting the virtual directory to an application.

Gmoliv
It is one, called 'Site', with Medium (Pooled) application protection.
jehuty
+1  A: 

The correct home page URL in this case should be:

http://localhost/default.aspx

What happens when you try that?

IrishChieftain
If I set the 'Default Web Site' to the project folder instead of using the Virtual Directory, it does work. The problem is I have a few different solutions to host locally, and this way, I'd only be able to satisfy one!
jehuty
That's correct. With IIS 5.1 you have to manually change the 'Default Web Site' to whatever you're working on.
IrishChieftain
But in that case, would Virtual Directories be useful at all?
jehuty
It's just an alias. In this case, "http://localhost" points to "site". With IIS7+ and ASP.NET 2.0+, you can simultaneously work on "http://localhost/site1" and "http://localhost/site2". Rest assured that you are doing nothing wrong - this is working as expected :-)
IrishChieftain
A: 

The best workaround I found was using this little IIS utility, IISAdmin.NET, found at http://iisadmin.codeplex.com

jehuty