Welcome to WebmasterWorld Guest from 54.234.38.8

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

SSI question

can I link to an SSI in another domain?

     
7:37 pm on Jan 11, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 9, 2002
posts:470
votes: 0


One of my domains uses an SSI construct to run a CGI script.

To avoid installing the script in all my domains I was wondering if I could just use an absolute link to that particular SSI command from all my domains.

I tried it and it didn't work.

Does anyone know any work around this problem?
Thanks.

7:44 pm on Jan 11, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 22, 2002
posts:1782
votes: 0


Just call the CGI script directly. (Well, do not call it directly since you cannot do that, but just reference the URI that will cause the CGI script to be run on the other server)

Andreas

9:47 pm on Jan 11, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 9, 2002
posts:470
votes: 0


I think that is what I did Andreas...

I had this from within the domain:

<!--#include virtual="/cgi-bin/blablabla.cgi" -->

so in my other domains I just called it as an absolute like this:

<!--#include virtual="http://www.domain-with-SII-command.com/cgi-bin/blablabla.cgi" -->

But it gave me an error...
Is this what you also suggested? txs.

9:48 pm on Jan 11, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 9, 2002
posts:470
votes: 0


I think that is what I did Andreas...

I had this from within the domain:

<!--#include virtual="/cgi-bin/blablabla.cgi" -->

so in my other domains I just called it as an absolute like this:

<!--#include virtual="http://www.domain-with-SII-command.com/cgi-bin/blablabla.cgi" -->

But it gave me an error...
Is this what you also suggested? txs.

10:01 pm on Jan 11, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 22, 2002
posts:1782
votes: 0


Sorry robertito62, I didnīt read your question properly and totally missed that you were wondering if I could just use an absolute link to that particular SSI command from all my domains.

If I had read that then my answer would have been a quick no.

The URL cannot contain a scheme or hostname, only a path and an optional query string.

[httpd.apache.org...]

What I meant is use the CGI scriptīs URI directly. The CGI script is run on each request of a page that uses your SSI command. I was suggesting letting the CGI script build the entire page that is now containing the SSI instruction.

Andreas

1:51 am on Jan 12, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 22, 2001
posts:2450
votes: 0


instead of calling a cgi script on another domain, why not call a cgi script on your own domain that uses LWP::Simple to call the cgi script on the other domain? Quick script:

#!/usr/bin/perl -w

print "Content-type: text/html\n\n";
use LWP::Simple;
$cgiReturn = get "http://www.someotherdomain.com/cgi-bin/foo.cgi";
print $cgiReturn;
exit;

3:34 am on Jan 12, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 9, 2002
posts:470
votes: 0


Andreas, ok, I got you know. Yes, I could do...a little more work.

volatilegx,
Not familiar with LWP::Simple

What I understand from this is:
1) setting up this script in one of my domains,
2) call it, so that in turn calls the original script on another domain...

In this case I could SSI your quick script, but is it simpler?

Thank you all.

9:27 pm on Jan 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 22, 2001
posts:2450
votes: 0


robertito62,

the LWP::Simple idea is very easy to implement. Just create a cgi script on your server using the code I provided above, and call it with your server side include. the script i wrote will call the second cgi script, and print out the output from that second script to the webpage that used the server side include.

What I understand from this is:
1) setting up this script in one of my domains,
2) call it, so that in turn calls the original script on another domain...

You are absolutely correct!
9:36 pm on Jan 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member rcjordan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 22, 2000
posts:9138
votes: 0


Ran into the same problem once, went the symlinks route

[webmasterworld.com...]

4:21 am on Jan 14, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 9, 2002
posts:470
votes: 0


Thanks everybody.

rcjordan,
I see how that may work, unfortunately my unix skills are limited. Any chance to have a step-by-step procedure? Sorry, but I had to ask.

4:27 am on Jan 14, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 22, 2002
posts:1782
votes: 0


ln -s TARGET
will create a symlink in the current directory that points to
TARGET
. Have a look at the man page for ln for more information on how to use
ln
.

Andreas

4:53 am on Jan 14, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 9, 2002
posts:470
votes: 0


ok andreas, i will give it a try in the next few days.

If the world wide web goes down...you know who to blame :)