Organizing Your HTML Files for Publishing


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 Webmaster

The 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:

  • Where on the server will I put my files? In most cases, someone will create a directory on the server where your files will reside. Know where that directory is and how to gain access to it.

  • What's the URL of my top-level directory? This URL will usually be different from the actual path to your files.

  • What's the name of the system's default index file? This file is loaded by default when a URL ends with a directory name. Usually it's index.html or index.htm, but it may be default.htm, or something else.

  • Can I run PHP, ASP, CGI, or other types of scripts? Depending on your server, the answer to this question may be a flat-out "No," or you might be limited to certain programs and capabilities.

  • Do you support special plug-ins or file types? If your site will include multimedia files (MP3, RealAudio, Shockwave, Flash, or others), your webmaster might need to configure the server to accommodate those file types. Make sure that the server properly handles special types of files before you create them.

  • Do you support FrontPage Server Extensions? Microsoft FrontPage, a popular web authoring tool for Windows platforms, enables you to develop web pages and complete websites. To take full advantage of its features, however, the web server must have FrontPage Server Extensions installed on it. If you're interested in using FrontPage to design advanced pages, be sure to ask your ISP whether it supports the Server Extensions.

  • Are there limitations on what or how much I can put up? Some servers restrict pages to specific content (for example, only work-related pages) or restrict the amount of storage you can use. Make sure you understand these restrictions before you publish your content.

  • Is there a limit to the amount of bandwidth that my site can consume? This is somewhat related to the previous question. Most web hosts only allow you to transfer a certain amount of data over their network over a given period of time before they either cut you off or start charging you more money. You should ask what your bandwidth allotment is and make sure that you have enough to cover the traffic you anticipate. (The bandwidth allotment from most web hosts is more than enough for all but the most popular sites.)

  • Do you provide any canned scripts that I can use for my web pages? If you aren't keen on writing your own scripts to add advanced features to your pages, ask your service provider whether it provides any scripts that might be of assistance. For example, many ISPs provide a script for putting a page counter on your home page. Others might provide access to form-processing scripts as well.

Keeping Your Files Organized with Directories

Probably 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 Filenames

Web 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.

Table 18.1. Common File Types and Extensions

Format

Extension

HTML

.html, .htm

ASCII Text

.txt

PostScript

.ps

GIF

.gif

JPEG

.jpg, .jpeg

PNG

.png

Shockwave Flash

.swf

AU Audio

.au

WAV Audio

.wav

MPEG Audio

.mp2, .mp3

MPEG Video

.mpeg, .mpg

QuickTime Video

.mov

AVI Video

.avi

Portable Document Format

.pdf

RealAudio

.ra, .ram


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.




Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day (5th Edition)
ISBN: 0672328860
EAN: 2147483647
Year: 2007
Pages: 305

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net