[thelist] Re: PHP and / instead of ?

Carl J Meyer cjmeyer at npcc.net
Tue Jan 21 00:02:01 CST 2003


Kelly and Rob are correct - this is a downside of using the PATH_INFO
method to pass data in the URL.  If you now have a URL like

http://example.com/page.php/some/data

the client (browser) thinks that it just requested a file named 'data'
from the directory 'page.php/some'.  So if it sees a dot-relative link
to a CSS file, javascript file, image file, or what-have-you, it will
look relative to (what it thinks is) the "page.php/some" subdirectory.

No solution (that I'm aware of) besides using only root-relative links.
Or you can hack it by prepending the correct number of '../' to all
links, if the number of data items you're passing is consistent.  But
that's just nasty...

A quick look through the source of an evolt page tells me that evolt
seems to have solved this one (their image links are not
root-relative).  Anyone from evolt want to comment on how this is done?

Carl





More information about the thelist mailing list