| <<< Home | << Web | < HTML Notes | Top | Bottom | Next > |
|
Topics on this page:
Finding a host for your siteIf you're brand new to HTML and building pages for the web, your first big hurdle is establishing your first site somewhere. You'll have to find a someone willing to host your pages on their server. You have several choices.
Here are a few links to help you find a free host: http://www.thefreesite.com/freewebpages.htm
Setting up your siteOnce you select a host for your web site, you'll have to move in. DirectoriesFirst, a little talk about directories. You probably have at least a basic understanding of directories (or "folders") on your own computer. You know that you can put files into a directory, and that you can put other directories into a directory. On your host computer, you'll be given a directory that's all yours. Just like on your own computer, you can put files into this directory. And you'll probably be able to create subdirectories within this directory (a few free providers may not allow subdirectories or may limit the number of levels of directories you can have). Your main directory will correspond directly to the URL that the host assigns you. For example, the URL http://wolves.dreamhost.com/ is the URL of my main directory. If I create a subdirectory named subdir, the URL for this subdirectory would be http://wolves.dreamhost.com/subdir/. HTML files and index.htmlLet's say I create an HTML file and name it main.html. If I upload this file into my main directory, you will access it with the URL http://wolves.dreamhost.com/main.html. You can place a "default" HTML file into any directory. Your host will let you know what to name the default file, but it will probably be index.html or index.htm. The default HTML file can be accessed just like any other: http://wolves.dreamhost.com/index.html. But if you leave off the file name at the end of the URL, the default HTML file is displayed. Using the URL http://wolves.dreamhost.com/ accesses the default HTML file. What if you don't create an index.html file? For many hosts, the default URL such as http://wolves.dreamhost.com/ will display a directory listing that shows the files in the directory if there is no default HTML file. If your host's server works in this way, you will probably want to put an index.html (or whatever name they use) into every directory you create to prevent people from snooping around your site. However, if you're taking an HTML class, it may be helpful if you don't create an index.html file - if you have problems getting your pages to display, it can be very helpful for the instructor to be able to view the directory contents. Other hosts block the directory listing. If there is no index.html file, the default URL will cause a "page not found" page to be displayed. Case sensitivity and naming problemsIf you're using a PC or Mac, you're used to having file names that are not case-sensitive. If you create a file named main.html, you can refer to it as main.html, MAIN.HTML, or MaIn.HtMl. Your computer doesn't care. Many hosts use Unix servers. Unix uses case-sensitive file names. If you name your file main.html, you have to refer to it exactly as main.html. If you try to use MAIN.HTML or MaIn.HtMl, you'll get back a file not found error. If your host uses NT servers, the file names won't be case-sensitive. But you should treat them as if they are, and do your best to match your names to the case. If you ever decide to move your site to a host that uses Unix servers, you'll have a much easier time of it. Believe me. I learned this first-hand when I moved my site from my NT-based GTE site to my Unix-based Dreamhost site. A naming problem to avoid is the use of spaces in a file name. If you really want to include spaces in a name, you can. But in any URL reference, replace the space with %20 to avoid problems. So if I name a file "my file.html", I would use http://wolves.dreamhost.com/my%20file.html to access the file. It's much simpler to just avoid using spaces. I would suggest avoiding pretty much all special characters when choosing names. If you stick to alphabetic characters and digits (and perhaps underscores) you'll avoid a lot of problems. There's another reason to avoid using special characters such as spaces, &, % and the like. Many search engines can't handle URLs that contain these types of characters, and you won't be able to list your site with those search engines if you've used these characters. Uploading your pagesThere are a number of ways to upload your pages to your site. Your choice may be determined by the host you select, or by your own personal preferences.
If you use an FTP program or publishing tool, you'll have to enter some configuration information the first time you use it to upload to a new site. You'll have to provide a name that is used to access your site (your host will provide you with this), and you'll have to indicate the type of system (your host will hopefully provide you with everything you need). I use WS/FTP myself, and don't have any experience with anything else. So I can only share my experiences with WS/FTP. WS/FTP uses two little windows to show two directory contents: the directory on your hard drive that you're uploading from, and the directory on your web site that you're copying to. It provides capabilities such as creating new directories, copying individual files, copying entire directories, renaming and deleting files, etc. It provides these facilities both on your hard drive and in your server directories, and you can actually copy files either direction. You'll want to spend some time investigating the various program options. For example, WS/FTP provides an option of forcing all file names to lowercase as you upload - you don't want to use that option if you're referring to file names with uppercase characters! Some people encounter a problem with their FTP program translating all file names to uppercase when they're transmitted. This has never happened to me, and I have no idea what causes it. To avoid this problem, you might want to user lower-case names exclusively, and use the "force file names to lowercase" option. You need to distinguish whether files are sent in ascii or binary format. Text files such as HTML files need to be sent in ascii format. On a PC, these files have a carriage return and a line feed at the end of each line - other systems use just one or the other. When you transfer in ascii format, the FTP program takes care of fixing these little things for you. But when you want to upload a file such as an image file or sound file, you don't want the FTP program to monkey around with stuff like that. When you send in binary format, the files are transferred exactly as is. With WS/FTP, you can click to choose ascii, binary or automatic. Automatic looks at the set of suffixes you set up to determine which types need to be transferred as ascii files. You will want to set it up so that .htm, .html, .txt, .js and .css files are sent as ascii. (You may need to add to this list over time as you learn to use additional types.)
|
| <<< Home | << Web | < HTML Notes | Top | Bottom | Next > |