Richard Lowe, Jr. wrote (to me privately):
When I initially set up ringlink, I had one domain
(internet-tips.net) and I created a dozen rings there. Now I have
250 or so domain names and I want to split the rings to more
appropriate locations. It would be great if ringlink had an option
to "redirect" a ring from within the CGI.
I'm not a perl programmer, but I might take a look at it myself...
What I need to do is define a new field for a ring (and it could
just be in the text file and not be reachable through the admin
screen) which is the redirect URL. If the field is non-black, I
would just redirect to wherever it says to go.
I think the attached script may be what you want.
Assume that "Demoring" at the Ringlink site was previously hosted by
"Gunnar's Ringlink" (which it actually was, btw...). Normally an
attempt to list the member sites at the old location would result in
the error message "Error! Ring ID "demo" does not exist in Gunnar's
Ringlink.".
But I did the following:
1) These two lines:
use ringredirect;
ringredirect::main{};
were added as the last two lines in the execstart() function in
rlmain.pm.
2) The attached script was uploaded as ringredirect.pm to the
Ringlink library.
So when you now enter the URL
http://www.gunnar.cc/cgi-bin/ringlink/list.pl?ringid=demo
you instead end up at
http://www.ringlink.org/cgi-bin/demo/list.pl?ringid=demo
/ Gunnar
package ringredirect;
use strict;
my %redir = (
demo => {
url => 'http://www.ringlink.org/cgi-bin/demo',
ext => '.pl',
},
otherring => {
url => 'http://www.otherdomain.com/cgi-bin/ringlink',
ext => '.pl',
},
);
sub main {
my $id = $rlmain::data{ringid};
return unless ($id and $redir{$id});
my ($file) = $rlmain::action =~ /^(\w+)/;
print 'Location: ', $redir{$id}{url}, "/$file", $redir{$id}{ext},
( $ENV{QUERY_STRING} ? "?$ENV{QUERY_STRING}" : '' ), "\n\n";
rlmain::exit();
}
1;