|03-24-2009, 12:05 PM||#1|
Join Date: Mar 2009
Location: North Saanich, British Columbia, Canada
You sound like you know what you’re talking about when it comes to issues of directory referencing. So, I’d like to bounce this off you:
I have been tasked to take over an existing site that is working just fine online. I’ll call it the “official” site. The previous developers were fired.
So, I used an FTP program to download the entire site and then tried to use that site as the basis for a new DreamWeaver project. I’ll call that new site the “test” site.
I have run into problems. Basically, the “official” site works just fine online now but when I tried to publish the identical site, as downloaded, from DreamWeaver I ran into serious problems:
1. The reference to a CSS main file, from an internal sub-directory, was wrong. So it would not preview correctly, nor did it display correctly on my “test” site.
The reason, as I discovered after reading your post, was that the internal referencing is wrong. Within a sub-directory of the root directory, the reference to the main CSS style sheet was: “/styles.css,” instead of “../styles.css,” as you recommended.
I changed all of the offending pages and the CSS worked just fine.
2. The reference to a main image directory, from an internal sub-directory, was also wrong. It was “/images.”
Again, following your advice to reference a directory above a current directory, I revised all sub-directory pages to use the convention “../images.”
After making these key changes, all of the files worked, as previewed in Dreamweaver and published to an FTP site.
The question, though, is why the current “official” site works just fine online even though these key linkages are incorrectly referenced?
R. Y. Glover & Associates
EDITORIAL AND MARKETING SERVICES
1455 McTavish Road, North Saanich
British Columbia, Canada, V8L 5T3
|03-24-2009, 12:56 PM||#2|
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
This is a absolute path..
so no matter how deep you are in your directory structure by referencing this path you will reference root/images
this however is a relative path
look at this structure
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
|03-26-2009, 10:40 PM||#3|
Join Date: Feb 2008
Wow DJ - that's awesome. I knew what worked but never knew 'why'... cheers.
I tend to use true absolute for sites where the images folders are buried deep - eg wordpress:
|03-27-2009, 03:08 PM||#5|
Join Date: Dec 2003
I heard some people say that absolute paths are bullet proof, so less risk.
I'm brought up on relative paths as well, and can't really shake em off either.