PATH_INFO in Apache is eating the first part of the path. Why?

Posted by makenai on Stack Overflow See other posts from Stack Overflow or by makenai
Published on 2010-05-19T06:54:56Z Indexed on 2010/05/19 7:00 UTC
Read the original article Hit count: 236

Filed under:
|
|
|

I'm writing a simple mod_perl handler that relies on $r->path_info() to do some request routing. However, I find that it's always eating the first part of PATH_INFO when mounted on root. Let's say that the handler just prints the value of $r->path_info:

<Location /TEST>
PerlHandler MyHandler
</Location>

Request: /TEST/123

Expected PATH_INFO: /123

Got PATH_INFO: /123 (yay!)

<VirtualHost *:80> # or <Location /> for that matter
PerlHandler MyHandler
</VirtualHost>

Request: /123

Expected PATH_INFO: /123

Got PATH_INFO: nothing! (boo!)

Request: /TEST/123

Expected PATH_INFO: /TEST/123

Got PATH_INFO: /123 (boo!)

What's happening here and how can I fix it to get the results I expect?

© Stack Overflow or respective owner

Related posts about mod-perl

Related posts about apache