Solved

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

Posted on 2004-09-29
4
145 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

New! My Passport Wireless Pro Wi-Fi Mobile Storage

Portable wireless storage to offload, edit, and stream anywhere.

High-capacity, wireless mobile storage designed to accompany professional photographers and videographers in the field to easily offload, edit and stream captured photos and high-definition videos.

Question has a verified solution.

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

Suggested Solutions

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

932 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

13 Experts available now in Live!

Get 1:1 Help Now