I have inherited a web site that has all of the paths set using relative paths, that only work when the site is located in the web root.
I have put the site in a virtual directory, and none of the paths work correctly.
<img src="/img/logo/BadCo.gif" width="156" height="55" alt="BadCo" />
I can resolve this as follows:
<img src='<%= ResolveUrl("~/img/logo/BadCo.gif") %>' width="156" height="55" alt="BadCo" />
However, I do not want to have to manually change every single one, of hundreds of paths throughout the project, and coming up with a regex to do the replace would hurt my tiny brain.
If it’s feasible you could just make the it a web site proper in IIS and just assign it a different port.
I take this approach on my dev machine if I want to get a website working on IIS proper rather than Cassini. So everything will be under http://localhost:%5Bportnumber%5D/.
If you have to use a virtual directory I’m out of ideas.