 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 4th, 2004, 11:21 AM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Site root and document relative paths.
I'm creating a website at the moment which is sitting in a folder on my C: drive called Everest. Inside that folder are some sub-folders called Templates, Images, Climb, etc.
I've designed some templates and have inserted some images. The filename to the images is /Images/image_name.gif if I choose Site-root relative links. But these don't actually work when you preview the site. Document relative links work fine. It's the same with links to different pages - document is OK, site root is all wrong.
I've checked the definition of my site and I can't see what the problem is. Local root folder is C:\Everest folder\ DEfault images folder is C:\Everest folder\Images\ Home page is C:\Everest folder\Images
Can anyone suggest what's going on?
Thanks
Nicole
|
|

October 4th, 2004, 02:44 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Is this a DNS site step, or a virtual, or what? That may be your problem...
|
|

October 4th, 2004, 02:55 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Yeah, it looks like your site is not set up to be run through IIS> Your remark: "Home page is C:\Everest folder\Images" makes me suspect you view the site in your Web browser using file://C:\, right?
If that is the case, you cannot use /Images for images. When you use a root relative address, the root refers to the current site or disk. With a "real" Web site, like http://www.YourSite.Com, /Images will end up as http://www.YourSite.Com/Images.
However, when you view the sire directly from your C drive, /Images will end up as C:\Images, which is not the folder that holds your images.
Cheers,
Imar
|
|

October 5th, 2004, 02:35 AM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Um so what's the solution? Sorry, but I'm not quite with you. I use F12 to preview my site - have never set up the whole DNS/virtual site thing. What I don't get is that the path shouldn't be /Images/image_name...it should be Images/image_name...but dreamweaver is automatically putting the / in.
Surely if this is your folder structure (where capital letters donates a folder):
EVEREST
TEMPLATES
IMAGES
index.html
Then to locate something relative to the site root (index.html) then the path should be IMAGES/image_name.gif?
The thing is, I'm working on Dreamweaver 4 at home and Dreamweaver 2004 MX at work. Might that be causing a problem?
The same problem is happening with any links I put, but I guess that's the same issue.
If I upload the site as is (with /Images/...) it works. Surely that's not right?!!
My brain hurts.
|
|

October 5th, 2004, 07:22 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
You have to use relative pathing everywhere. I believe that is the only solution. So if you need to go up one folder use the ../ notation.
Brian
|
|

October 5th, 2004, 05:35 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
What path do you get in the browser when you press F12? That is, what did you setup in the project settings for Local, Remote and Testing Server?
The way it's supposed to work that inside the template, you can use ../Images. Then when you create a page based on this template in the root, Dreamweaver will (should??) adjust the path to Images/
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|
 |