You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Larry Leszczynski <la...@furph.com> on 2002/11/04 22:31:38 UTC

Apache lifecycle: can I choose which VirtualHost?

Hi everyone -

Suppose a request comes in which would normally get sent to the default
VirtualHost (because it's missing a Host header, or the name in the Host
header isn't recognized, or whatever).  Is there any mod_perlish way to
explicitly handle that request with a different (non-default) VirtualHost,
by modifying the request headers or request URI?  From experimenting it
seems like PerlPostReadRequest is already too late, and the VirtualHost
has already been chosen.  Failing that kind of manipulation, is there a
way to "swap in" the configuration from the desired VirtualHost just for
the handling of that request?


Thanks!
Larry Leszczynski
larryl@furph.com


Re: Apache lifecycle: can I choose which VirtualHost?

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi there,

On Mon, 4 Nov 2002, Larry Leszczynski wrote:

> Suppose a request comes in which would normally get sent to the default
> VirtualHost (because it's missing a Host header, or the name in the Host
> header isn't recognized, or whatever).  Is there any mod_perlish way to
> explicitly handle that request with a different (non-default) VirtualHost,
> by modifying the request headers or request URI?

I assume that this means something about the request will make it
possible to decide which of the vhosts it should really have gone to.
Couldn't you could just get the default vhost to rewrite the URI based
on that information?

> From experimenting it seems like PerlPostReadRequest is already too
> late, and the VirtualHost has already been chosen.

Yup.

> Failing that kind of manipulation, is there a way to "swap in" the
> configuration from the desired VirtualHost just for the handling of
> that request?

I don't think that's going to fly...

73,
Ged.