On Fri 11 Jul 2008, Mike Friedman wrote:
> I've got a mod_perl handler setup like so, within a vhost:
>
> <Location /myapp>
>         SetHandler perl-script
>         PerlResponseHandler MyApp::Dispatcher
> </Location>
>
> Under this setup, if I navigate to /myapp/foo/bar/baz, I get:
>
> PATH_INFO => /foo/bar/baz
> SCRIPT_NAME => /myapp
>
> This makes sense. However, if I then change the Location block from
> /myapp to /, the behavior changes:
>
> PATH_INFO => /bar/baz
> SCRIPT_NAME => /foo

Path_info determination depends on the layout of files and directories on your 
filesystem. I'd advise against using it in anything like a dispatcher. Just 
for fun try to create a regular file /myapp/foo/bar in your docroot and use 
your first setup. You'll see PATH_INFO=/baz.

Instead use $r->location and $r->uri to compute a version of path-info by 
yourself. Something like that:

  $pi=$r->uri;
  $loc=$r->location;
  $pi=~s/^\E$loc\Q//;

Torsten

--
Need professional mod_perl support?
Just hire me: [EMAIL PROTECTED]

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to