Solved

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

Posted on 2004-09-29
4
151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

717 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