Re: rewrite url in modperl

Torsten Förtsch <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Monday 01 February 2010 15:19:34 [email protected] wrote:
> > Keep in mind that /path/12345.mp4 is still a valid URI and hence can be
> > requested by the browser. But you can check if the request is the result
> > of an internal redirect by checking $r->prev and deny it unless set.
> 
> That's a cool idea.
> But how to set it? I never used $r->prev in my before experience.
> 
you don't have to. apache does it for you.

When a request comes in $r->main and $r->prev are false. If it issues a 
subrequest $subrequest->main keeps $r so that the subrequest can modify the 
main one. Similar, if the main request is replaced by an internal_redirect() 
$redirectrequest->prev points to the main request in case you need something 
from there.

Torsten
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.