[ic] Dynamically setting PageDir

interchange-users@lists.akopia.com interchange-users@lists.akopia.com
Thu May 17 10:45:01 2001


How can I set the PageDir based on the $ENV{HTTP_HOST}?

>From catalog.cfg
This works:
VendURL http://__SERVER_NAME____CGI_URL__
VendURL <&EOF
sub {
        return "$ENV{HTTP_HOST}__CGI_URL__";
}
EOF

But this does not:
PageDir /www/__DOMAIN_NAME__/htdocs/ic
PageDir <&EOF
sub {
    return q{/www/__DOMAIN_NAME__/htdocs/ic} if ($ENV{HTTP_HOST} =~ 
/^(www|devo)/);
    return qq{/home/$1/www/__DOMAIN_NAME__/htdocs/ic} if ($ENV{HTTP_HOST} 
=~ /^(bill|eli|fyl|larry)/);
    return q{../htdocs/ic};
}
EOF

I have set up a separate development environment for each of our 
developers. Each developer has their own IC catalog. The only differences 
between the developer catalogs is the PageDir. I would like to eliminate 
the separate developer catalogs and just set the PageDir on the fly based 
on the requested URL. If the requested URL is bill.worldwideimpact.com/ic 
then the PageDir should be /home/bill/www/worldwideimpact.com/htdocs/ic.

Bill Carr
Worldwide Impact
bill@worldwideimpact.com
413.253.6700