PATH_INFO in Apache is eating the first part of the path. Why?
- by makenai
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?