You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by sadhanandham balaraman <sa...@hotmail.com> on 2000/05/05 12:39:53 UTC

Redirecting Problem --- Please look at this patiently.

Hi Gurus,
   I'm facing a typical problem in Apache web server. The problem is that I 
want to call a perl script whenever a request is made to the server, and 
that script should be able to change the URI and submit to the server back.

   The thing I got from the net is that adding PerlscriptTransHandler 
directive will call a perl script, whenever request is made. The problem 
with this is that it disables Alias and ScriptAlias directives, so my other 
perl scripts won't run.

     The other thing is redirecting any request using RewriteRule. I used 
this to redirect any request to my perl script which again redirects to 
another document which is in same server by 'Location' header. The problem 
is that it goes to endless recursive request loop.

     So how to call a perl script or redirect the request to the SAME web 
server.

    Please add reply immediately.

Thanks,
sadha.

(sadha1@hotmail.com)
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


Re: Redirecting Problem --- Please look at this patiently.

Posted by Matt Sergeant <ma...@sergeant.org>.
On Fri, 5 May 2000, sadhanandham balaraman wrote:

> Hi Gurus,
>    I'm facing a typical problem in Apache web server. The problem is that I 
> want to call a perl script whenever a request is made to the server, and 
> that script should be able to change the URI and submit to the server back.

Make a PerlHandler that does  $r->internal_redirect(URI);

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org


Re: Redirecting Problem --- Please look at this patiently.

Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 5 May 2000, sadhanandham balaraman wrote:

> Hi Gurus,
>    I'm facing a typical problem in Apache web server. The problem is that I 
> want to call a perl script whenever a request is made to the server, and 
> that script should be able to change the URI and submit to the server back.
> 
>    The thing I got from the net is that adding PerlscriptTransHandler 
> directive will call a perl script, whenever request is made. The problem 
> with this is that it disables Alias and ScriptAlias directives, so my other 
> perl scripts won't run.

if your PerlTransHandler returns OK, then the mod_alias translate handler
is skipped.  just change the uri in your TransHandler and return DECLINED
to let mod_alias do it's thing.
 
>      The other thing is redirecting any request using RewriteRule. I used 
> this to redirect any request to my perl script which again redirects to 
> another document which is in same server by 'Location' header. The problem 
> is that it goes to endless recursive request loop.
> 
>      So how to call a perl script or redirect the request to the SAME web 
> server.

$r->internal_redirect should work.  we'd need a tiny example that
reproduces the recursion problem to help with that.