if you are going to redirect in embperl then you need to put an exit after
$r->status(REDIRECT).
just setting that variable does not cause embperl to exit.  so,

[-
  use Apache;
  use Apache::Constants qw(REDIRECT);

  $r = Apache->request;

  $r->header_out("Location" => "x.html");
  $r->status(REDIRECT);
  exit;
-]
2

should do the trick.

cliff rayman
genwax.com

Dirk Lutzebaeck wrote:

> Hi,
>
> I haven't quite got it why I can't use redirection when using a chain
>
> The chain is
>
> <FilesMatch "y.html">
> SetHandler perl-script
> Options ExecCGI
> PerlHandler Apache::OutputChain Apache::EmbperlChain Apache::PassFile
> </FilesMatch>
>
> <FilesMatch "x.html">
> SetHandler perl-script
> Options ExecCGI
> PerlHandler Apache::Embperl
> </FilesMatch>
>
> y.html:
>
> 1
> [-
>   use Apache;
>   use Apache::Constants qw(REDIRECT);
>
>   $r = Apache->request;
>
>   $r->header_out("Location" => "x.html");
>   $r->status(REDIRECT);
> -]
> 2
>
> Requesting y.html returns just '1 2', no redirection is taking place.
>
> I have also tried $r->internal_redirect and
> $r->internal_redirect_handler also in combination with Apache::exit()
> all with the same result.
>
> It works when setting PerlHandler only to Apache::Embperl in the first
> FilesMatch.
>
> Dirk

Reply via email to