homepage Welcome to WebmasterWorld Guest from 54.243.17.133
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

    
SSI question
can I link to an SSI in another domain?
robertito62




msg:964631
 7:37 pm on Jan 11, 2003 (gmt 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.

 

andreasfriedrich




msg:964632
 7:44 pm on Jan 11, 2003 (gmt 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

robertito62




msg:964633
 9:47 pm on Jan 11, 2003 (gmt 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.

robertito62




msg:964634
 9:48 pm on Jan 11, 2003 (gmt 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.

andreasfriedrich




msg:964635
 10:01 pm on Jan 11, 2003 (gmt 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

volatilegx




msg:964636
 1:51 am on Jan 12, 2003 (gmt 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;

robertito62




msg:964637
 3:34 am on Jan 12, 2003 (gmt 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.

volatilegx




msg:964638
 9:27 pm on Jan 13, 2003 (gmt 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!

rcjordan




msg:964639
 9:36 pm on Jan 13, 2003 (gmt 0)

Ran into the same problem once, went the symlinks route

[webmasterworld.com...]

robertito62




msg:964640
 4:21 am on Jan 14, 2003 (gmt 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.

andreasfriedrich




msg:964641
 4:27 am on Jan 14, 2003 (gmt 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

robertito62




msg:964642
 4:53 am on Jan 14, 2003 (gmt 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 :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved