My Images/Style Sheets/Javascript Are Broken

by James Cook on June 17, 2009

I frequently get questions like this:

My site works fine on my computer but when I upload it the [fill in the blank] are broken.

My first response is one I use to address of lot of issues: Make sure your site is properly defined. It's critical enough that I wrote a tutorial, Define Your Site, for the Dreamweaver Club forum and also included the information in my Let's Get Started with Dreamweaver mini-course.

Once that's out of the way the next thing to do is take a look at the source code of your page and see if any of the links are hard-coded to point to a file on your local computer. If they are, they will point to URLs that look something like this: file:///C/site/test.html. There are a few ways this might happen:

  • Your site is defined incorrectly (but we've already addressed that)
  • You try to link to a file outside your root folder (and don't let Dreamweaver move it for you when it asks)
  • You copy code from a file that hasn't yet been saved (Dreamweaver uses file:/// links until you save a page for the first time) into another page
  • Dreamweaver screws up (it happens but not as often as some folks like to think)

The fix is relatively simple. Once you're sure you have everything set up correctly, recreate the links. You can find the ones that need fixing by searching the source code for "file:///"

As always, feel free to email me with your questions, comments and suggestions. And please follow me on Twitter (DWcourse) for additional Dreamweaver news and tips.

Comments on this entry are closed.

Previous post:

Next post:

Home | Make Contact