troubleshooting Question

Classic ASP Virtual Directory Relative and Absolute Paths

Avatar of cartch2008
cartch2008 asked on
ASPMicrosoft IIS Web Server
4 Comments1 Solution3984 ViewsLast Modified:
I have a website set up in IIS called "mysite" which points to d:\inetpub\wwwroot\mysite.  I have created a virtual directory under that site that points to d:\inetpub\wwwroot\shared.  

Under d:\inetpub\wwwroot\shared, I have the following folders:
admintool (d:\inetpub\wwwroot\shared\admintool)
under admintool I have:
images (d:\inetpub\wwwroot\shared\images)
includes (d:\inetpub\wwwroot\shared\includes)
administration (d:\inetpub\wwwroot\shared\administration)

in the includes folder, I have an asp page called top.asp.  In that page I have an image tag as follows:  <img src="/shared/images/myimage.jpg" />

in the administration folder, I have an asp page called main.asp.  In that page I have an include statement as follows:  <!-- #include virtual="/shared/admintool/includes/top.asp" -->

Everything works fine that way it is stated above.  I was hoping not to have to use the absolute server paths in my image tag and include statements.  ie:  I wanted to have my image tag be <img src="images/myimage.jpg" />  But, I guess that when open "mysite" in a browser and go to the main.asp page (http://mysite/shared/administration/main.asp)  then it is trying to find the myimage.jpg file under d:\inetpub\wwwroot\mysite\images\ instead of d:\inetpub\wwwroot\share\admintool\images.

This is probably quite confusing, but, is there any way to get around this?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros