You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Chawke, Nitin (Corporate, consultant)" <ni...@ge.com> on 2005/07/10 02:41:35 UTC
Forwarding manipulated URI
Hi All,
I am using mod_perl's PerlTransHandler for manipulating the request URI.
And forwarding the manipulated URI. I am getting the desired result page in the response, but the browser url does not change to the redirected page. But if I do a request redirect after manipulating the URI, the chagned uri does show up in the browser. Is there any way I would manipulate the URI, get the response with the manipulated URI, change the browser URL without actually redirecting the request.
This is the code that I am using:
$r->uri($new_uri);
$r->headers_out->add('Location' => ($new_uri));
return Apache2::Const::REDIRECT;
This solves the purpose.
But I want to use something similar to below (this shows the page but the browser URL shows the old uri and not the manipulated):
$r->uri($new_uri);
$r->headers_out->add('Location' => ($new_uri));
return Apache2::Const::REDIRECT;
Any inputs are appreciated.
Thanks,
Nitin
Re: Forwarding manipulated URI
Posted by Jonas Alves <jo...@co.clix.pt>.
I don't see any diferences in the tow ways you are showing. :)
But no, there is no way to change the browser url without redirecting
the request.
--Jonas
On 10 de jul de 2005, at 01:41, Chawke, Nitin (Corporate, consultant)
wrote:
> Hi All,
> I am using mod_perl's PerlTransHandler for manipulating the request
> URI.
> And forwarding the manipulated URI. I am getting the desired result
> page in the response, but the browser url does not change to the
> redirected page. But if I do a request redirect after manipulating the
> URI, the chagned uri does show up in the browser. Is there any way I
> would manipulate the URI, get the response with the manipulated URI,
> change the browser URL without actually redirecting the request.
>
> This is the code that I am using:
> $r->uri($new_uri);
> $r->headers_out->add('Location' => ($new_uri));
>
> return Apache2::Const::REDIRECT;
>
> This solves the purpose.
>
> But I want to use something similar to below (this shows the page but
> the browser URL shows the old uri and not the manipulated):
> $r->uri($new_uri);
> $r->headers_out->add('Location' => ($new_uri));
>
> return Apache2::Const::REDIRECT;
>
>
> Any inputs are appreciated.
>
> Thanks,
> Nitin
>