Working Directory when using URL rewriting
Posted: Thu Jul 20, 2006 2:23 pm
Hi all!
I'm using URL rewriting to change that:
http://www.example.com/word/an-other-word/yet-another
into:
http://www.example.com/index.php?var1=a ... et-another
The rewriting works good. The problem I have is with the working directory of my php file.
When I type directly http://www.example.com/index.php?var1=a ... et-another, I can include images files with relative links, such as "src=images/image.gif".
But when I type http://www.example.com/index.php?var1=a ... et-another, it's not working, I have to use absolute link (src="/images/image.gif") or a relative link such as "src=../../images/image.gif".
I'd prefer to use relative links, because it's handier to move a whole directory to a sub-directory on a server (a /beta/ to test it before releasing for example).
Is there a way to solve my problem?
Thanks a lot!
I'm using URL rewriting to change that:
http://www.example.com/word/an-other-word/yet-another
into:
http://www.example.com/index.php?var1=a ... et-another
The rewriting works good. The problem I have is with the working directory of my php file.
When I type directly http://www.example.com/index.php?var1=a ... et-another, I can include images files with relative links, such as "src=images/image.gif".
But when I type http://www.example.com/index.php?var1=a ... et-another, it's not working, I have to use absolute link (src="/images/image.gif") or a relative link such as "src=../../images/image.gif".
I'd prefer to use relative links, because it's handier to move a whole directory to a sub-directory on a server (a /beta/ to test it before releasing for example).
Is there a way to solve my problem?
Thanks a lot!