Forum Moderators: coopster & phranque

Message Too Old, No Replies

'absolute' SSI call?

         

rcjordan

2:43 pm on Dec 2, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've been playing around with SSI and can get the calls to work as long as the include files are in the same domain. No problem at all with a call that looks like this:
<!--#include virtual="/includes/siteheader.txt" -->

BUT, if I try to call from another domain on the same server, for example:
<!--#include virtual="/www/html/domain2/includes/globalheader.txt" -->
I get an error trying to process this directive

I'm pretty sure the path is right, it's the same as the one used for ftp. I've tried setting permissions (but the include files were in the public area anyway), and with/without the leading "/" ...what else have I missed?

sarkye

2:54 pm on Dec 2, 2001 (gmt 0)

10+ Year Member



it's not your page extension is it?

.htm(l) versus .shtm(l)

rcjordan

2:57 pm on Dec 2, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, in this case, I'm using .shtml for testing.

Xoc

6:34 pm on Dec 2, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think it is the cross domain issue. The virtual filename resolution is based on the URL, not on the file system. So it has to be within the same domain. However, you could do a Unix link to the file to put it into the same domain as the file you are coming from. That should solve the problem without having issues of multiple copies of the file.

Gorufu

12:53 am on Dec 3, 2001 (gmt 0)

10+ Year Member



> you could do a Unix link

Xoc, I assume you are referring to symbollic links.

rcjordan,

Symbollic links will work. From within document root directory of the domain calling the ssi create a symbollic link. Note that the symbollic link directory will need to be a different name to includes.

ln -s /www/html/domain2/includes/ include

---------------------------

Another way is to use an Alias directive inside the <VirtualHost> directive.

For example

<VirtualHost domain1.com>
ServerName domain1.com
DocumentRoot /www/html/domain1
.....
.....
Alias /include /www/html/domain2/includes
</VirtualHost>

To call the ssi from other domain you will need to use

<!--#include virtual="/include/globalheader.txt" -->

Key_Master

1:33 am on Dec 3, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I had the same problem. Fixed it by uploading a separate .htaccess file with
AddType text/x-server-parsed-html html
in the sub domain directory. Works fine now.

netcommr

11:22 pm on Dec 3, 2001 (gmt 0)

10+ Year Member




The included file when use with the 'virtual' attribute MUST be a server parsed page itself. Such as:

<!--#include virtual="/www/html/domain2/includes/globalheader.shtml" -->

could this be it??

------------

I hate to even say this, but do you have the file names correct? siteheader.txt vs. globalheader.txt ??

rcjordan

11:51 pm on Dec 3, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>but do you have the file names correct?

Yep. They work fine as-is, just as long as I use a relative path within the domain.

(I haven't had time to return to this problem yet. Fire calls elsewhere.)

rcjordan

4:53 pm on Dec 30, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I ended up going the symbolic link route, it works.

For those reading along at home, here's the tutorial I used [hotwired.lycos.com] to figure out what the WebmasterWorld *nix-heads were talking about.

Friday

4:00 am on Feb 22, 2002 (gmt 0)

10+ Year Member



Are you usinf the _FULL_ path?

e.g.:

/home/www/html/domain2/includes/globalheader.shtml

vs.:

/www/html/domain2/includes/globalheader.shtml