Forum Moderators: mack

Message Too Old, No Replies

Are Server Side Includes across servers possible?

         

Palimpsest

8:36 pm on May 10, 2006 (gmt 0)

10+ Year Member



Is it possible to do server side includes across servers? I'm using ASP and JavaScript. I saw a way to do it with php somewhere else but that is not currently one of my available resources.

Example.

I have a file called file.inc

It lives on the server with www.website.com. I also want to include the file on subsite.website.com.

Is this even possible? I can't seem to find any way of doing it.

jatar_k

3:37 pm on May 11, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



are they on the same server? I am guessing they are.

I don't know the exact code but I would think you could include them via the filesystem, the url shouldn't really matter. Use a normal include and just use the full path to the file you want included.

Palimpsest

5:37 pm on May 11, 2006 (gmt 0)

10+ Year Member



Actually I have found several different layouts. There are some that are on the same server and that sounds like a great solution for those situations. Thanks so much for that.

There are others that actually do cross servers.
subsite1.website.com is on one server
subsite2.website.com is on a different server

jatar_k

5:39 pm on May 11, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



again I don't know about ASP so I couldn't give you code but you should be able to include using the full url

TechnoGeek

11:32 pm on May 13, 2006 (gmt 0)

10+ Year Member



Hi, Palimpsest.
The SSI include tag provides the way to insert a *FILE* into an HTML page.
The following:
<!--#include virtual="/includes/page.htm"-->
would insert the contents of the file /includes/page.htm into the current HTML document at the insertion point.
As it can be seen, the reference is to a file, not an URL. This means, IMO, that you can include anything that is within the file tree of your domain. You should consult with your hosting provider the exact details as these may vary depending on the Web server software they are using.

webdoctor

10:18 am on May 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is it possible to do server side includes across servers?

Even if it were possible, it sounds to me like a crazy idea from a security point of view.

Your server should never run untrusted code. IMHO code that's not physically on your server can't be fully trusted (unless you have a secure private network connecting your servers) - it's too easy to attack your DNS and end up sending arbitrary code to your server. Ouch.