You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Marc Lambrichs <ma...@melange-it.nl> on 2006/12/06 15:31:09 UTC

using subrequest to different server

I'm trying to change a subrequest to do a request to a different server 
than the originating one. I'm not sure if this is possible. Anyway, I've 
skipped the internal_redirect because - am I correct? - this is bound to 
the originating server.

My second thought was using lookup_uri(), but I'm not sure this can be done.

Ofcourse, I'm trying to avoid a normal redirect either through apache 
config, or mod_rewrite or defining a separate handler. Any ideas?

Cheers,
Marc


Re: using subrequest to different server

Posted by Aaron Trevena <aa...@gmail.com>.
On 06/12/06, Marc Lambrichs <ma...@melange-it.nl> wrote:
> I'm trying to change a subrequest to do a request to a different server
> than the originating one. I'm not sure if this is possible. Anyway, I've
> skipped the internal_redirect because - am I correct? - this is bound to
> the originating server.
>
> My second thought was using lookup_uri(), but I'm not sure this can be done.
>
> Ofcourse, I'm trying to avoid a normal redirect either through apache
> config, or mod_rewrite or defining a separate handler. Any ideas?

What is the context of the redirect?

Are you just fetching something and providing it as is - i.e.
proxying, if so then mod_proxy would be your friend (ProxyPass and
ProxyPassReverse are very very handy)

Otherwise, presumbably you're executing some code to do something
and/or decided if you need to proxy the content, in which case it's a
bit trickier and you may need to use LWP or something to fetch the
data yourself.

I don't know of a mod_perl way to redirect to another server, but I'd
be interested to know if it was possible.

A.

-- 
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Hosting