How to Name New Page Files in Dreamweaver
Don’t turn into a panicked web designer because of broken links caused by Dreamweaver filename conflicts. These problems usually don’t occur until after a website is published on a server, so they can be especially confusing and difficult to understand.
If you’re publishing your website to a web server that runs on a Mac or under Windows, the following may not apply to you. But if you’re using a web server that runs Unix or Linux (used by many commercial web-hosting companies), the following instructions are especially important. If you’re not sure, be safe and follow these rules when you save web pages, images, and other files on your site:
Include an extension at the end to identify the file type. Examples include .html for HTML files and .gif for GIF images. Dreamweaver automatically adds the .html file extension to the end of HTML files, which works for most web servers.
However, in the rare case that you need to change the extension to .htm for your web server, you can do so in Dreamweaver’s Preferences dialog box by choosing Edit→Preferences (Windows) or Dreamweaver→Preferences (Mac). See the Displaying file extensions in Windows sidebar for tips on how to view file extensions, which are hidden in Windows.
Don't use spaces or special characters in filenames. For example, don’t name a web page with an apostrophe or spaces, such as cat's meow page.html. If you want to separate words, you can use the underscore (_) or the hyphen (-).
For example, meow-page.html is a fine filename. Numbers are okay in most cases, although it’s best not to start a file name with a number. Capital letters generally don't matter, but most designers stick with lowercase. Doing so keeps filenames consistent and makes setting and checking links easier because the name of the file and its reference in any links must match.
The reason for all this fuss? Filenames are especially important in websites because they’re included in the HTML code when you set links. A link from one page to another is essentially made up of the name of the file.
Links with names that include spaces and special characters work just fine in most browsers when you test pages on a Mac or a PC computer, but many web servers on the Internet use software that doesn’t accept spaces or special characters in links. Thus, links that don’t follow these rules may get broken when you publish the site to a web server.
By following these three simple rules — no spaces, no special characters, and keep everything lowercase — you ensure that your links will work on any system.
How to display file extensions in Windows
When you view pages in Windows Explorer, you won’t see the file extension of your GIFs, JPEGs, or HTML pages (although these extensions will be displayed in the Files panel in Dreamweaver) unless you change the settings on a Windows computer.
To change the settings so that you can see extensions in Windows Explorer, open the Folder Options dialog box, choose the View tab, and then look through the long list of options and deselect Hide Extensions for Known File Types.
How you open the Folder Options dialog box depends on which version of Windows you’re using. You should be able to find the dialog box easily if you search for Folder Options in the Help section.
Name the first page index.html
Another confusing rule is that the main page of your website must be called index.html (on some Windows-based servers, the first page should be named default.html). Most servers on the Internet are set up to serve the index.html or default.html page first, but you should check with your web-hosting service or the administrator who managers your web server to confirm the name required for your server.
Essentially, when a web browser comes to a domain name, such as DigitalFamily.com, the first page that opens is index.html. Similarly, when a web browser is directed to a subfolder within a site, it also displays the index page first.
As a result, if you create a subfolder with the name books, for example, and inside that subfolder you create a page named index.html as the main page, you can tell visitors to your site to simply enter www.DigitalFamily.com/books to arrive at the books page within your site. If you name the first page anything else, such as books.html, visitors have to type www.DigitalFamily.com/books/books.html to open the page.
The rest of the pages in your site (or any subfolder) can be named anything you like. Just remember: Don't include spaces or special characters (except the hyphen or underscore).
It doesn’t matter if you use uppercase or lowercase letters when typing a domain name, but everything that comes after the .com (or .net, or whatever the ending of your domain name) must match the case of the file and folder names.