Solved

windows 2000 - IIS - virtual include paths in virtual directories - how do they work?

Posted on 2004-09-29
4
144 Views
Last Modified: 2013-11-18
Operating system: windows 2000
Web server: IIS 5.0

Note: I asked a similar question yesterday, but did not realize the answer related to Apache not IIS. So I'm trying again.

My Web host says I have to use the path:

include virtual="/btslmtrad2.datasecure.net_non_ssl/niveau-b/includes/connect_db.asp"

I've given it some thought and I've figured that I can live with using the virtual folder name in my path: "/niveau-b/", because on my local installation of IIS, my virtual directory name would also have to be included in the path.

But I don't want to use "/btslmtrad2.datasecure.net_non_ssl"

Is there any way it can be removed from the path by some setting or configuration or something?

Ideally, my path would be the following:

include virtual="/niveau-b/includes/connect_db.asp"

Can anyone who is familliar with IIS help?

If you know of a solution, could you phrase it in a way that my Web host help agent would undertand?

Thanks




0
Comment
Question by:vanauden
  • 3
4 Comments
 
LVL 14

Accepted Solution

by:
alimu earned 500 total points
ID: 12196276
Hi,
hope this explains things for you.

if you can create an IIS root level virtual directory that points to the niveau-b directory, called "niveau-b" then yes, you could do this.  If your ISP has you running your site out of a subweb then I doubt you will have any option but to use the address they have provided.

The / at the beginning of the path provides an absolute reference to a location.  / indicates the root of the IIS site.
Another thing to note is that your end-users don't see the include statement, just the contents of the resource being included so from the end-user perspective the syntax is irrelevant.

[Further info: If you do not have the / at the beginning of the path, it becomes a relative path reference.  The problem with using relative paths for includes is that you have to continually adjust the path depending on which directory you are calling the include file from.  The larger your site gets, the more of a nightmare this becomes.  If you use relative paths and then later down the track shift a directory to somewhere else in your site hierarchy, you would have to go through and recode every one of these links.]
0
 
LVL 14

Expert Comment

by:alimu
ID: 12196291
btw - if you are having a problem on the development machine due to the path they have provided, you can always create yourself an IIS virtual directory called btslmtrad2.datasecure.net_non_ssl with the same subdirectory structure they are using.  This will allow you to replicate the live environment.
0
 
LVL 1

Author Comment

by:vanauden
ID: 12221063
I think you are right alimu. It must be a subweb.

That is the only way I can figure it. Something like a virtual directory within a virtual directory.

For my situation (building sites for customers to place on their server at project completion) that sucks!

Thank you, alimu, for your input and help on this.

0
 
LVL 14

Expert Comment

by:alimu
ID: 12222496
no problem - it's not pretty looking with that particular address but it actually makes things pretty flexible if your include paths are absolute (i.e. starting with \).  It means that as long as you keep your includes in the same place you can shift around your subwebs as much as you want.  
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now