Welcome to WebmasterWorld Guest from 18.104.22.168
Forum Moderators: phranque
I'm passing a variable to a script in the 'fancy' format of "localhost/myscript/myvar" instead of "localhost/myscript.php?myvar", and this works quite well.
HOWEVER, this method creates a SERIOUS problem with relative paths:
When opening "localhost/myscript/myvar", a relative link that should point to "index.php" now points to "myscript/index.php", which does not exists. This is, ALL files linked from from myscript are now pointing to an invalid path, because "myscript" is taken as a subdirectory for all relative-path links.
This problem applies to ALL files with relative URL (css, js, etc), causing all of them to be not found when accesing the script.
There are millions of sites that pass variables this way; I checked out some sources, and files are also linked with relative paths... yet they magically point to the right path somehow.
I hope I explained myself correctly, because the problem is quite hard to specify and my native language is spanish. Any help is really appreciated.
PS. I can explain it completely again in different terms to try to make it clearer, but I can't link to any example because this forum does not allow any kind of links.
Another option is to consider using a
URI defined in the document
I think the <base href="http://www.example.com/"> should do the trick, I just hope it's recognized by non-Microsoft browsers and mobile WAP browsers as well.