RE: path_info() query.

2002-07-04 Thread Wes Cravens

Ok... I can see this.

The piece of the puzzle that I am missing is why it behaves differently for
/ than for /stuff.

I have taken out the  information.  I would have thought that
when Apache saw
www.host/stuff and there was no 'physical' stuff than it would pass /stuff
as path_info to the module from


...
PerlHandler Module


Why does it not do this for /?

Thanks for the help,

Wes

> -Original Message-
> From: giorgos zervas [mailto:[EMAIL PROTECTED]]
> Sent: 04 July 2002 15:28
> To: Wes Cravens
> Cc: modperl
> Subject: Re: path_info() query.
>
>
> hi,
>
> 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 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!
>
> best regards,
> giorgos
>
> Wes Cravens wrote:
> > Hello all,
> >
> > This is perhaps an apahce uri translation problem but:
> >
> > I am having a path_info problem...
> >
> > Synopsis.
> >
> > 
> > SetHandler perl-script
> > PerlHandler Module
> > 
> >
> > Module.pm returns $r->path_info() in html to client.
> >
> > url: 'www.host/' returns '/'
> > url: 'www.host/debug' returns '' when I was expecting '/debug'
> >
> > Now I can get around this with $r->uri but want to make sure that I
> > undestand what I don't understand.
> >
> > Thanks for any help.
> >
> > Wes
> >
> > Rev. FPCED(UK)
> >  y n=-09hu6+40563
> > 2136+-*+96,
> > 3.-/n*+963.h
>
>
>




Re: path_info() query.

2002-07-04 Thread Valerio_Valdez Paolini


On Thu, 4 Jul 2002, Wes Cravens wrote:

> url: 'www.host/' returns '/'
> url: 'www.host/debug' returns '' when I was expecting '/debug'

does a file or directory named 'debug' exist in your document root?
If so, it's normal. It is also possible that you are doing an error
I made many times :) You are just facing a 'silent' 404 error, because
the correct way to add path info to your first example is

url: 'www.host/index.html/' returns '/'

assuming that index.html is in your DirectoryIndex directive.
So when you invoke url www.host/ you are being redirected to
www.host/index.html.

Hope it helps.

Ciao, Valerio

 Valerio Paolini, 
--
 what is open-source about? Learn, and then give back




Re: path_info() query.

2002-07-04 Thread giorgos zervas

hi,

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 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!

best regards,
giorgos

Wes Cravens wrote:
> Hello all,
> 
> This is perhaps an apahce uri translation problem but:
> 
> I am having a path_info problem...
> 
> Synopsis.
> 
> 
>   SetHandler perl-script
>   PerlHandler Module
> 
> 
> Module.pm returns $r->path_info() in html to client.
> 
> url: 'www.host/' returns '/'
> url: 'www.host/debug' returns '' when I was expecting '/debug'
> 
> Now I can get around this with $r->uri but want to make sure that I
> undestand what I don't understand.
> 
> Thanks for any help.
> 
> Wes
> 
> Rev. FPCED(UK)
>  y n=-09hu6+40563
> 2136+-*+96,
> 3.-/n*+963.h