Forum Moderators: phranque

Message Too Old, No Replies

Transparently redirecting data posted to a cgi

         

Carloz

5:06 pm on Oct 8, 2005 (gmt 0)

10+ Year Member



Hello

Is there a way to transparently redirect the data, that gets posted to a cgi, to another cgi?

I have a few sites (domainA.com, domainB.com...) which eatch posts data to a cgi at domainZ.com. All sites are on the same virtual server.

Now, I would like to disguise the fact that all sites post to domainZ.com and instead let them post their data to domainA.com/cgi-bin/abc.cgi etc. and redirect the posted data transparently to domainZ.com/cgi-bin/abc.cgi.

I tried it with a RewriteRule in htaccess at domainA.com but I had no success.

Birdman

8:06 pm on Oct 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I haven't tested this, but it should work ;)

Point the form to this script on domainA.com, etc..

#!/usr/bin/perl
my $url = 'ht*p://domainZ.com/cgi-bin/script.cgi?' , $ENV{'QUERY_STRING'};

use LWP::Simple;
my $content = get $url;
die "Couldn't get $url" unless defined $content;

print $content;

Carloz

5:15 pm on Oct 10, 2005 (gmt 0)

10+ Year Member



Thanks Birdman!

Unfortunately the form uses method = Post.

Do you happen to know the code for this too?