my $realname = 'http://www.main.org';
my %vnames = ( 'sec.ondary.com' = 'second', 'third.dom.com' = 'third' );
^^^
foreach (keys %vnames) {
^^^
$VirtualHost{'192.168.1.2:80'} = {
ServerName = $_,
RedirectPermanent = ( ['/', "$realname/$vname{$_}/index.phtml"] )
^^
Maybe this is just in your example, but you might have cut-and-pasted from
yor config, so I'll mention it: In your RedirectPermanent, you are referencing
%vname, not %vnames. Without strict turned on in your Perl section, Perl
won't tell you.
Yep, I caught this one a few minutes ago (but if I had read my mail earlier,
your message would have saved half of my day. Well, there are times like
that...).
I'm getting somewhat closer, I think it's now just a matter of understanding
more precisely 'what' should be used as the RedirectPermanent value. This
work just fine now :
Perl
my $realname = 'real.domain.com';
my %vnames = ( 'prim.ary.com' = 'first', 'sec.ondary.com' = 'second' );
$VirtualHost{'192.168.1.2:80'} = [ { ServerName = $realname } ];
foreach (keys %vnames) {
my $vhref = {
ServerName = $_,
RedirectPermanent = "/ http://$realname/$vnames{$_}/"
};
push @{$VirtualHost{'192.168.1.2:80'}}, $vhref;
}
/Perl
Whenever I ask for http://prim.ary.com, I get transparently redirected to
http://real.domain.com/first. Cute. Almost there.
But I have other URLs I want to remap. Say, prim.ary.com/europe should be
mapped to real.domain.com/europe. With the above setup, I am redirected to
real.domain.com/first/europe. So I need now to have _several_ RedirectPermanent
(or anything that could save my whole day -- well, night, it's 23 pm here).
I have tried a helluva lot of syntaxes, I'm ashamed to say, to no avail. The
right one just escapes me.
Any hints ?
Tia,
-- Pierre-Yves BONNETAIN
CTO -- http://www.rouge-blanc.com -- Fastest wines in Europe.