PDA

View Full Version : Links Broken When Viewing Locally


hunter858
09-15-2008, 10:13 PM
I am having an issue with the local viewing of a site. I am a moderate user of dreamweaver and my boss wants me to clean up a website and add some new content.

Somehow, he created the site so that when I try and view it locally through explorer, the internal links as well as all the pictures aren't working correctly. So basically, I can't preview my page in my browser! I finally tracked it down to this:

The code in my html file is:

<IMG SRC="/htmlgifs/hondoheadder_01.jpg" WIDTH=252 HEIGHT=209>

But when view into the browser locally, the pictures don't show up. When I click on the properties of that picture, it shows the missing file as: file:///C:/htmlgifs/hondoheadder_01.jpg. Clearly, this is not where it should be (as my local site is in a folder on the desktop).

It works fine when I post it and view it on my remote server. I've noticed that if I remove the forward slash before "htmlgifs", it will work fine when I preview it locally. But, I've got to work with a site of maybe 100 pages and I'm worried about the find and replace making the site go screwy. Is there anything I can do to be able to view these files locally without changing a ton of html on every single page?

Thanks,
Kyle

Ricky55
09-15-2008, 10:25 PM
They should work with or without the / I think, although the / shouldn't be necessary.

Have you defined a site in Dreamweaver telling Dreamweaver where the Root folder of the sites resides on your computer?

I would take the folder off the desktop anyway, its not really ideal to have a website on the desktop, I would copy the folder first off into My Docs, and then either define a site in Dreamweaver or point the existing site to the new location and try again.

Ricky55
09-15-2008, 10:26 PM
and preview the pages via Dreamweaver.

hunter858
09-15-2008, 10:35 PM
The backslash isn't necessary for sure. Remotely, it seems to not make a difference. But when viewing it locally, is messes everything up for me. (I've checked on two different computers.)

I think it's not a dreamweaver issue, because ideally, I should just be able to double click on the html file and open it with explorer. I've tried moving the folder to somewhere else on the c drive, and even in my documents folder. It's something about how internet explorer opens the local files. I was just hoping someone here has run into the same problem or can figure out what I need to do.

K

Cary
09-16-2008, 12:06 AM
Your links are root-relative instead of document-relative, so browsers can't view the pages correctly on your local computer. You can try using temp files for previewing. I don't know if this will help, but the setting is in preferences. Check the "Preview using temporary files" box in the "Preview in Browser" category.

In the site definition you can select whether links are relative to the document or to the root (Advanced tab, Local Info category). I don't know if this will change existing links.

Ricky55
09-16-2008, 12:08 AM
Just try viewing via Dreamweaver do they view OK rather than through the OS

hunter858
09-16-2008, 12:52 AM
Cool... changed the preferences to preview the temp files and it works. Is there any reason why anybody would build root relative rather than document relative?

K