mapping URI to filename. - modperl

This is a discussion on mapping URI to filename. - modperl ; Using mod_perl2, is there a way of mapping a URI to a filename or directory. I can get the root directory for the server and I can append the URI to it but this doesn't taking to account aliases, UserDir ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: mapping URI to filename.

  1. mapping URI to filename.

    Using mod_perl2, is there a way of mapping a URI to a filename or
    directory.

    I can get the root directory for the server and I can append the URI to
    it but this doesn't taking to account aliases, UserDir directives etc..

    Any suggestions?

    Anthony.


  2. Re: mapping URI to filename.



    Anthony R Fletcher wrote:
    > Using mod_perl2, is there a way of mapping a URI to a filename or
    > directory.
    >
    > I can get the root directory for the server and I can append the URI to
    > it but this doesn't taking to account aliases, UserDir directives etc..
    >
    > Any suggestions?


    $r->filename()

    http://perl.apache.org/docs/2.0/api/...ml#C_filename_

    --Geoff


  3. Re: mapping URI to filename.

    Thanks but that only works for the current request. I was looking for a
    way of translating some other URI to a pathname on the same server.


    Anthony

    On 18 Aug 2008 at 15:26:53, Geoffrey Young wrote:
    >
    >
    > Anthony R Fletcher wrote:
    > > Using mod_perl2, is there a way of mapping a URI to a filename or
    > > directory.
    > >
    > > I can get the root directory for the server and I can append the URI to
    > > it but this doesn't taking to account aliases, UserDir directives etc..
    > >
    > > Any suggestions?

    >
    > $r->filename()
    >
    > http://perl.apache.org/docs/2.0/api/...ml#C_filename_
    >
    > --Geoff


    --
    Anthony R Fletcher
    Room 2033, Building 12A, http://dcb.cit.nih.gov/~arif
    National Institutes of Health, arif@mail.nih.gov
    12A South Drive, Bethesda, Phone: (+1) 301 402 1741.
    MD 20892-5624, USA.


  4. Re: mapping URI to filename.



    Anthony R Fletcher wrote:
    > Thanks but that only works for the current request. I was looking for a
    > way of translating some other URI to a pathname on the same server.


    $r->lookup_uri('/some/uri')->filename()

    http://perl.apache.org/docs/2.0/api/...#C_lookup_uri_

    --Geoff


  5. Re: mapping URI to filename.

    Perfect. Thank you.

    Anthony

    On 19 Aug 2008 at 09:53:03, Geoffrey Young wrote:
    >
    >
    > Anthony R Fletcher wrote:
    > > Thanks but that only works for the current request. I was looking for a
    > > way of translating some other URI to a pathname on the same server.

    >
    > $r->lookup_uri('/some/uri')->filename()
    >
    > http://perl.apache.org/docs/2.0/api/...#C_lookup_uri_
    >
    > --Geoff


    --
    Anthony R Fletcher
    Room 2033, Building 12A, http://dcb.cit.nih.gov/~arif
    National Institutes of Health, arif@mail.nih.gov
    12A South Drive, Bethesda, Phone: (+1) 301 402 1741.
    MD 20892-5624, USA.


+ Reply to Thread