I am designing a website at the moment and looking at the difference
between relative and absolute url links which is driving me crazy! I
would like to use relative paths, but it is proving very restrictive as
to how I design the file structure when it comes to including files. I
currently have something like below:
folder1
folder2
images
---image1.gif
includes
---header.php
---footer.php
folder3
---folder4
---file0.php
---file1.php
---file2.php
index.php
I am currently thinking I will have to run all my scripts at the same
level to ensure I can include the header.php file in all my pages while
maintaining the integrity of links in the header.php. For example, if I
include header.php in index.php and header.php is referencing
.../images/image1.gif in the images folder, the link will no longer be
valid when included in index.php. Does that make sense?
Can anybody share some tips on what they do to overcome what must be a
very common problem? Is absolute paths the answer so instead of calling
.../images/image.gif from the include file, I would call /images/image1.gif?
Any help that anybody can give me would be much appreciated.
Thanks,
Mark.