Ne maramo .html
[The Index Page][How To Do
It][Creating A Directory]
[The Big Hint]
After I put up Java
Goodies I began to get letters asking how I am able to post pages that
do not require the .html extension. To some it may seem simple enough,
but to those new to the HTML game, it isn't. So here's the trick.
My assumption is that you have a WWW
site right now, correct? That means that you have a general idea that you
need to place files from your computer to a server so the whole world can
see them. It's called FTP'ing a file. Some call it uploading.
When you upload, you are uploading to a directory.
That directory is a little section of the server's hard drive set aside
and given a name. Let's say your home page address is:
http://www.fred.com/~wwwuser
The name of the directory that you upload or
FTP all your files to is "wwwuser." See that above? Now, what you may not
know is that that directory has a certain set of rules that it follows.
The main rule is that it allows any and everybody to look at its contents.
It's a WWW directory and people can access it right? Another rule is that
you are given personal access, with the use of a login and password, to
place and remove files.
The rule you may not be aware of, and the one
that will be of the upmost importance to this little tutorial is that that
directory has been told to look for a specific file name when someone logs
in. Notice the address above again. Notice it doesn't call for any specific
page. It could, of course, just by adding a slash and then the page name
like so:
http://www.fred.com/~wwwuser/joe.html
But that's not what happened. All that was
listed was the name of the directory. Again, look at the original address
towards the top. Better yet, look at HTML
Goodies or Java Goodies
or the address at the the top of your browser window. See the address
is
http://www.htmlgoodies.com/directory/
None of these addresses call for a certain
page, but one comes up. That's because of the third rule I spoke of earlier.
I hope you were paying attention...and spit out that gum.
The Index Page
When you got your WWW site, you were told to give
the home page a certain name. The vast majority of the time that name is
index.html. Why? Because the directory that holds your WWW files
has been told when someone tries to get access to the directory, by default,
display the index.html page. Get it?
Now, don't get flustered if your default page
isn't index.html. I have been on many different servers. One wanted www.html,
the other wanted HomePage.html (note the capitalization) and a third wanted
default.html. My webmaster wizards here at HTML Goodies tell me that you
can configure a server to search for booger.html if you really wanted.
But that would lead to a sticky situation. *Rim-shot*. (Thank you folks,
good night! Try the Veal.)
How To Do It
Geeze, it took me a while to get to this didn't
it? I tend to ramble. So, how do you do it? Well, the rule of thumb here
is to remember that any sub-directory (a directory inside a directory)
retains all the properties of the parent directory.
Huh?
Any directory inside a bigger directory will do
what the big directory does just because. That's my best "Gen-X" speak.
So if you make a directory inside of wwwuser,
then that directory will also display its own index.html. If you make a
smaller directory inside that directory, then it will display its own index.html.
Get it?
Creating a Directory
I have been sent so many letters telling me that
that I go the long way in making a directory. True, there are software
programs out there that will do all of this with the click of a button,
but in case you don't have such an animal, try this. If you do have a program
that will do all of this on the fly. Go nuts.
-
Telnet in to your site.
-
Get to your directory. Usually when you telnet into your site, you are
either in, or one directory above, your www directory where you keep all
your files.
-
Try typing at the prompt: cd [name of your www directory]
-
If that doesn't work, type cd .. (two periods) and then try step
three again. If you don't get any errors, you're there.
-
If you would like, you can type ls at the prompt and that will give
you a listing of all your files.
-
To create the directory, type mkdir [directory name]
-
You can now do another ls command and you should see that directory
sitting there.
-
Some servers need for that directory to be "turned on" before anyone can
use it. So just to be safe, type chmod [directory name] a+rx now.
If the server won't take that command, try substituting a+rx with 777.
-
Log out. You're done.
Now you have a second directory sitting inside
of your wwwuser directory. That directory will respond to its own index.html.
Let's say you named the directory "skippy." Now you can tell people to
go to:
http://www.fred.com/~wwwuser/skippy
...and they'll get the main page with no html.
Now, how easy it that? Once you do it, it's a joke the second time.
THE BIG HINT!!
I'm going to tell you right up front what will
mess you up. You will replace the wrong index.html with the wrong index.html
at least once. I will bet you a zillion clams. I've done it at least ten
times. Always make a point of checking your work after you transfer stuff.
That allows you mistakes to be fixed straight away. Bye-bye.