Forum Moderators: phranque

Message Too Old, No Replies

Getting friendly URL parameters via Apache lookback

PATH_INFO or REQUEST_URI

         

aperantos

1:12 pm on Jun 13, 2005 (gmt 0)

10+ Year Member



Hello,

Which variable should I be parsing to handle friendly URLs via Apache's lookback feature, and more importantly why should I do it that way?

For example:
URL: http://example.com/directory/script/category/item
REQUEST_URI = /directory/script/category/item
PATH_INFO = /category/item

I have been using REQUEST_URI and stripping the unnecessary details by starting parsing at the character position that is equal to the length of SCRIPT_NAME.

But I have seen various tutorials using both variables but none giving a reason why they use the one they do as opposed to the other. Should I be using PATH_INFO and why?

Michael.