On Mar 22, 2006, at 2:49 PM, Michael Greenish wrote:
It's been a while since I set up the server but I
think I did it because setting up the apache config
file was easier. And the redirect works under normal
circumstances, but not when coming from an internal
redirect. What is the difference? Is there another
way to perform the redirect in registry mode?
I'd guess one of two things (but i'm usually wrong about this stuff.)
a_ there might be some sort of redirect limiter config option. i
know a few MTAs have something like that when redirecting an email
address to avoid endless loops.
b_ maybe it has something to do with the footnote at that registry
recipe:
http://perl.apache.org/docs/2.0/user/coding/
cooking.html#Sending_Cookies_in_REDIRECT_Response__ModPerl__Registry_
note that this example differs from the Registry example only in
that it does not attempt to fiddle with $r->status() -
ModPerl::Registry uses $r->status() as a hack, but handlers should
never manipulate the status field in the request record.
that sounds to me like it has to do with the nature of the redirect
as an internal subrequest and not an external one. i'm only
speculating, but i think the subrequest is a nested request like this:
possible implemetation
request {
subrequest
{
redirect
}
}
and that anything not fatal is essentially ok
that would be dissimilar to it being a 'startover' with a new url
like this:
possible implemetation
request {
redirect
}
subrequest
{
redirect
}
in either case, if someone who works on the internals could clarify
that, i've been wondering this for a while.
the naming of the api and placement of methods, to me, is really
awkward - subrequest suggests that its an entirely new request nested
in $r (which, judging by the rest of the class methods, it seems to
be ) but having internal_redirect in there suggests that its a
redirect and startover for the parent request. in sure there is a
very good reason why redirect is in subrequest and not request -
could someone point me to a url where i can read up?
in any event, i'd look into $r->is_initial_req
http://perl.apache.org/docs/2.0/api/Apache2/
RequestUtil.html#C_is_initial_req_
and try something like that recipe to subrequests only.