perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giorgos zervas <gior...@perlfect.com>
Subject Re: $r->path_info() getting confused
Date Sun, 08 Sep 2002 01:20:42 GMT
hi there,

someone asked a similar question a while ago and here the answer that i 
gave them... i think it answers your question too.

---- START ----

apache uses a simple technique for determining the path_info. it starts 
at your document root and looks for the directory you specified in your 
URI. it continues to go deeper in the directory structure until it 
encounters a directory(or file) that doesn't exist. when this happens 
the path_info is set to rest of the URI (not including the last part 
which wasn't found!).

so in your case apache looks for $DOCROOT/debug

this doesn't exist (presumably) in your $DOCROOT. so the path_info is 
set to whatever is left, ie nothing!

if you tried to request www.host/debug/foo

the path_info would be /foo (without the /debug part)

if you created a directory called debug inside you docroot and you tried 
the previous example then you path_info would be empty.

i hope this doesn't confuse you a a lot!

----- END ----

in your example you request /rms/module/foo

apache looks for /rms in your docroot and /rms is not found.

consequently the path_info is set to the remaining part of the URI, ie 
/module/foo

apache doesn't take into consideration Location directives when setting 
the path_info as far as i know.

best regards,
giorgos

Fran Fabrizio wrote:
> 
> In my conf file, I have the following directives:
> 
> <Location /rms>
>    AuthType Apache::AuthCookieRMSDBI
>    AuthName RMS
>    PerlAuthenHandler Apache::AuthCookieRMSDBI->authenticate
>    PerlAuthzHandler Apache::AuthCookieRMSDBI->authorize
>    require valid-user
> </Location>
> 
> <Location /rms/module>
>  SetHandler perl-script
>  PerlHandler RMS::Control::Module->handler
> </Location>
> 
> When I call the URL /rms/module/foo, and in 
> RMS::Control::Module->handler I examine $r->path_info, I get as a value 
> '/module/foo' rather than the expected '/foo'.  If apache recognized 
> that /rms/module/foo was to go to RMS::Control::Module->handler then it 
> knows that /rms/module is the script name and thus should know that 
> path_info should be just /foo, right?
> 
> Thanks,
> Fran



Mime
View raw message