[ic] Mangling DirectoryIndex

Peter peter at pajamian.dhs.org
Thu Dec 6 08:58:56 EST 2007


On 12/06/2007 03:58 AM, Ton Verhagen wrote:
> Hi All,
> 
> Would it be possible to set the value of the DirectoryIndex config
> variable in an Actionmap?

You can certainly set the value, but I don't think it would do anything
at that point.

> I would like to serve a different entry page for different domains.
> 
> In the interchange.cfg I have got entries like:
> Catalog  mycat  alias           www.domain_1.com
> Catalog  mycat  alias           www.domain_2.com
> Catalog  mycat  alias           www.domain_3.com
> etc.
> 
> I test for a domain and set the $Config->{DirectoryIndex}  to a
> page name in an Actionmap.
> 
> For www.domain_1.com e.g.
>         $Config->{DirectoryIndex} = "index_1.html";
> 
> The $Config->{DirectoryIndex} is being set, but the page
> doesn't show up. The standard index.html is being served instead.
> 
> What could I be missing?

It's a chicken and egg problem, by the time the ActionMap is called the
page to display is already determined (and stored in
$CGI->{mv_nextpage}).  If you want to change that page simply set
$CGI->{mv_nextpage} to whatever you want and return 1 from your
ActionMap sub.

See <http://www.interchange.rtfm.info/icdocs/config/ActionMap.html> for
more info.

Peter



More information about the interchange-users mailing list