[ic] Dynamically setting PageDir

interchange-users@lists.akopia.com interchange-users@lists.akopia.com
Thu May 17 14:51:01 2001


On Thu, May 17, 2001 at 10:49:04AM -0400, bill@worldwideimpact.com wrote:
> 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


Hmmm, I had a hard time getting something similar to work with 
process pages but I was not setting PageDir.

Why not just run different catalogs?

http://__SERVER_NAME__/bill/__CGI_URL__
http://__SERVER_NAME__/joe/__CGI_URL__
http://__SERVER_NAME__/bob/__CGI_URL__

> 
> 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
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users

-- 

Christopher F. Miller, Publisher                             cfm@maine.com
MaineStreet Communications, Inc         208 Portland Road, Gray, ME  04039
1.207.657.5078                                       http://www.maine.com/
Content management, electronic commerce, internet integration, Debian linux