Naming Conventions, File Structure and URLs
Don't worry - I'm not going to go too deep here - but you will need some
knowledge of naming conventions, file structure and the anatomy of a URL!
Let's start with the file structure.
Basics of File Structure
- Each drive on a computer has a name. For example, the hard drive on
the PC that you are working on is the c drive and the server drive where
you save your files is the h drive.
- Each drive is divided into directories or folders that are also
given names. When we talk about a directory on a drive, we separate the drive and the
directory name with a back slash ("\"),
e.g., h:\givenss.
- Directories (or folders) can have subdirectories (a directory inside of another directory). Again, when we talk about
drives, directories and subdirectories, we separate each with a back slash ("\"),
e.g., h:\givenss\htmlfiles.
- Files are stored inside of directories or subdirectories. A file can be any type of
a file: a word document, a graphic or an html document. Graphic files are stored in a separate subdirectory (named images or graphics). An example of a file in a subdirectory is:
h:\givenss\htmlfiles\mypage.html.
- Notice that we are using back slashes ("\"). In Notepad (or the Windows environment) when you want to open/save a file by entering the drive and
directories as well as the filename, you use a back slash. But when you access directories on the Internet or in your HTML code, you use forward
slashes ("/"). This can be a little confusing at first, but you will get used to it.
Naming Conventions
- In the days of DOS (before Windows), file names could only be 8 characters long plus
a three character extension. File names can now be much longer and may contain spaces.
Windows file names still have a 3 or 4 character extension, but you may not always see it.
For example, Word documents have the extension .doc appended to the file name and HTML documents
have .htm or .html appended to the file name, but Windows has an option to show (or not show) the extension.
- When creating HTML files for the Web, you can use either .htm or .html. If you upload to a Unix server, you should use the four-character .html extension. The main thing is to be consistent. Do not mix .htm and .html on your website! (Unix servers see these as separate files.)
- Never, never use spaces in your HTML directories or file names. Some browsers see a space as "%20",
making it difficult to link to the file.
- Be consistent in your naming conventions. It is best to use all lower case or a file name like "aboutSequoia.html". (By the way, there are very strict file-naming conventions that help identify the type of file as well as the file name.)
Anatomy of a Uniform Resource Locator (URL)
- A URL is just an address for a web page. Nothing more.
A URL looks like: http://www.seq.org/~sgivens/lessons/week2.html.
But what does it mean?
- http:// tells the browser (e.g., Netscape or Internet Explorer) that
it should use hypertext transport protocol (rules) to load the page.
- www.seq.org/ is the domain name that is registered for the Web.
No one can have a domain name without first registering it. Some companies
register for a domain name and allow others to post web pages that are
accessible through their domain name (e.g., GeoCities).
- ~sgivens/ is an assigned directory on a server supported by the
registered owner of www.seq.org (Sequoia district). When you see a tilde (~) in a
URL, be aware that it is a user's page and not a page produced by
the webmaster. (This may mean that the information is not reliable -
more on this later!)
- lessons/ is a subdirectory in the ~sgivens directory.
- week2.html is the file name of an html page in the lessons subdirectory.
- The initial page of a website is usually named index.html. It is a good idea to have
an index.html page in each directory because index.html is the default page for the directory. It prevents users from dropping into a list of files in that directory if they do not enter a document name.
Back to the Week 2 Schedule