Thanks Jerry, the trouble I have is that my hosting provider sets the
document root to /home so if I was to use absolute paths I would have to
do somethign like
/home/path/to/the/public_html/images/image1.gif
which is a bit long winded. I could store it in a variable but it would
be better if I could set document root to the public_html folder. Do you
know how I can do this with out changing the httpd.conf file?
Thanks.
Jerry Stuckle wrote:
> mark wrote:
>
>> 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.
>
>
> I generally use absolute pathnames. I seldom use relative ones.
>
Received on Mon Oct 17 21:09:31 2005