Solved

Use include virtual in a subdomain

Posted on 2006-07-06
7
440 Views
Last Modified: 2013-11-18
Is it possible to use include virtual in a subdomain and include a file from the root?
0
Comment
Question by:AndreasA
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 6

Expert Comment

by:Dragonlaird
ID: 17050404
I'm assuming you're asking if you can use something like:

<!-- #Include virtual="http://subdomain.mydomain.com/MyFile.asp" -->

In a file on a website host like:

http://maindomain.mydomain.com

???

If so, the answer is no, you can't include a file outside of your own site using the above method. If the file contains only HTML, there are other ways to embed it into your page but if the file contains code such as functions that you need to access, you will need to re-create those functions within another file in your own site.
0
 
LVL 25

Accepted Solution

by:
kevp75 earned 500 total points
ID: 17050833
unfortunatley Dragon, using an http:// in a virtual include will never work, it would be a huge security risk to sites every where if it did.

it is along those same lines however....<!--#include virtual="/includesFolder/includeFile.ext"-->    will insure the page starts in the applications root folder, then goes to includesFolder.

What you have to do is make sure that it is a true subdomain (ie....make sure the subdomains headers are correct, and it is a seperate site)

to use an include from the domains root (not the subdomains root), you could use  <!--#include file="../rootIncludes/includefile.ext"-->
0
 
LVL 6

Expert Comment

by:Dragonlaird
ID: 17050958
Yeah kev, I know it's a security risk and that it can't be done, which is why I said the answer is no in my initial response.

I was just using the line above to clarify if this what what AndreasA was actually asking cos it's fairly well known that you can't use the Include option to embed files from another domain, sub-domain or website etc.

However, I didn't want to dishearten AndreasA by simply saying, No, no, no... Hence I added the bit about how to get around it depending on the content of the SSI file they wanted to embed ;-)
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 14

Expert Comment

by:CyrexCore2k
ID: 17054047
No you can't.

However you could, say perhaps map a virtual disk to the computer and folder where this asp file is and then creating a virtual directory in IIS?
0
 

Author Comment

by:AndreasA
ID: 17056779
thanks for the comments. is is not even possible some how when it is on a subdomain? on the same server?
0
 
LVL 14

Expert Comment

by:CyrexCore2k
ID: 17059220
If it's on the same server why don't you just create a virtual directory for the directory that contains the asp files you need?
0
 

Author Comment

by:AndreasA
ID: 17064458
Included the file using "<!--#include file="../www/site/inc/header.inc.asp"-->" where "www" is the root domain. Works fine.

Thanks for your help and comments.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

772 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