Once you have access to a web server, you can publish the website you've labored so hard to create. Before you actually move it into place on your server, however, it's important to organize your files. Also, you should have a good idea of what goes where to avoid lost files and broken links. Questions to Ask Your WebmasterThe webmaster is the person who runs your web server. This person also might be your system administrator, help desk administrator, or network administrator. Before you can publish your site, you should get several facts from the webmaster about how the server is set up. The following list of questions will help you later in this book when you're ready to figure out what you can and cannot do with your server:
Keeping Your Files Organized with DirectoriesProbably the easiest way to organize your site is to include all the files in a single directory. If you have many extra filesimages, for exampleyou can put them in a subdirectory under that main directory. Your goal is to contain all your files in a single place rather than scatter them around on your hard drive. You can then set all the links in those files to be relative to that directory. This makes it easier to move the directory around to different servers without breaking the links. Having a Default Index File and Correct FilenamesWeb servers usually have a default index file that's loaded when a URL ends with a directory name rather than a filename. One of the questions you should ask your webmaster is, "What's the name of this default file?" For most web servers, this file is called index.html. Your home page, or top-level index, for each site should have this name so that the server knows which page to send as the default page. Each subdirectory should also have a default file if it contains any HTML files. If you use this default filename, the URL to that page will be shorter because you don't have to include the actual filename. For example, your URL might be http://www.myserver.com/www/ rather than http://www.myserver.com/www/index.html. Caution If you don't put an index file in a directory, many web servers will enable people to browse the contents of the directory. If you don't want people to snoop around in your files, you should include an index file or use the web server's access controls to disable directory browsing. Also, each file should have an appropriate extension indicating its type so the server can map it to the appropriate file type. If you've been reading this book in sequential order, all your files should have this special extension already and you shouldn't have any problems. Table 18.1 lists the common file extensions that you should be using for your files and multimedia.
If you're using multimedia files on your site that aren't part of this list, you might need to configure your server to handle that file type. You'll learn more about this issue later in this lesson. |