0

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?

jehuty
  • 528
  • 1
  • 6
  • 20

3 Answers3

1

The correct home page URL in this case should be:

http://localhost/default.aspx

What happens when you try that?

IrishChieftain
  • 15,108
  • 7
  • 50
  • 91
  • 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 Oct 13 '10 at 21:46
  • That's correct. With IIS 5.1 you have to manually change the 'Default Web Site' to whatever you're working on. – IrishChieftain Oct 13 '10 at 21:48
  • But in that case, would Virtual Directories be useful at all? – jehuty Oct 13 '10 at 21:49
  • 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 Oct 13 '10 at 21:52
0

Try converting the virtual directory to an application.

Retired_User
  • 1,595
  • 11
  • 17
0

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

jehuty
  • 528
  • 1
  • 6
  • 20