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

Is $r->uri() what you're looking for?

Replies are listed 'Best First'.
Re^2: How to get the value of <Location> directive (mod_perl)?
by Burak (Chaplain) on Dec 10, 2006 at 17:56 UTC
    No. If the requested uri is "/foo/bar/baz" then $r->uri == "/foo/bar/baz" not "/foo"
      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.
      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 :)