Even if you don’t yet have a website or remote web server, Dreamweaver expects you to organize your files exactly as they would be in a real site. Before you can start working, you need to define a site.
If you’re upgrading from Dreamweaver CS4 or earlier, site definition has been considerably simplified. All you need to do is to designate a folder as the root—or top level—of your site. What I normally do is create a folder called Sites at the top level of my C drive on Windows or in my Home folder on Mac OS X. And then create a separate subfolder for each site inside the Sites folder.
Creating a New Site Definition
When you’re building a new site, the folder doesn’t need to contain any files. You add your site assets as you go along.
- In Dreamweaver, select Site > New Site to open the Site Setup dialog box.
- There are just two fields to fill in
- Site Name identifies your site in the Dreamweaver Files panel. It doesn’t matter if the name contains spaces.
- Local Site Folder. Click the “Browse for folder” icon next to the field, and navigate to the root folder for your site.
- Click Save—and that’s it. You’re done. The site is now listed in the Files panel, and you can start building your local version of your website.
File and folder names should not contain spaces or special characters, because these will cause problems with URLs on your website. It's also a good idea to use lowercase characters only. Most web servers are case-sensitive, so getting the wrong mixture of uppercase and lowercase characters results in broken links.
If you want to move or rename files in a site, always do so in the Files panel, and Dreamweaver will automatically update the file paths and names in related files. It will also warn you if deleting a file will result in broken links. If you make changes outside Dreamweaver, no updates will be made.
You can create as many sites as you like in Dreamweaver, but each site should always have a separate root folder.
Editing a Site Definition
- To edit site definitions, go to Site > Manage Sites.
- Select the site name, and click the icon that looks like a pencil. This reopens the Site Setup dialog box, where you can make changes.
- You can also delete a site by clicking the minus icon. Dreamweaver warns you that it cannot be undone. However, deleting a site from the Manage Sites dialog box only removes the site definition from Dreamweaver. It doesn’t affect the files on your hard disk.
There are many other options in the Site Setup dialog box, such as the login details for the remote server that hosts your live website, but you don’t need to set them until you’re ready to upload your files.