in reply to Re: How to get the value of <Location> directive (mod_perl)?
in thread How to get the value of <Location> directive (mod_perl)?

No. If the requested uri is "/foo/bar/baz" then $r->uri == "/foo/bar/baz" not "/foo"
  • Comment on Re^2: How to get the value of <Location> directive (mod_perl)?

Replies are listed 'Best First'.
Re^3: How to get the value of <Location> directive (mod_perl)?
by perrin (Chancellor) on Dec 10, 2006 at 20:14 UTC
    I don't think you can get what you're asking for, because I don't think apache provides it. When I want to know which location I matched, I do something like this:
    <Location /blah> PerlSetVar matched "blah" </Location>
    And then in my handler:
    if ($r->dir_config('matched') eq 'blah') {
    That serves my needs. However, if you want a definitive answer about whether this can be retrieved directly from apache or not, you need to ask on the mod_perl mailing list.
Re^3: How to get the value of <Location> directive (mod_perl)?
by Devanchya (Beadle) on Dec 10, 2006 at 18:19 UTC
    I think your looking into APR::URI.
    Haven't had much time to play with mod_perl2, but I think your looking at rpath and not path.

    Now I'm off to play with mod_perl2 instead of working on the real work... thanks :)

    --

    Even smart people are dumb in most things...
      No, APR::URI is not what I'm looking for. But may be it can be Apache2::Directive :)