Thank you for visiting WebMasterKnowHow.com - If you can suggest things that should be added to the site I would like to hear about them. Anything regarding hosting, HTML, attracting traffic, problems and mistakes. I intend to make this site as useful as I can, and with that in mind I'm trying to add at least one new topic every week.
Organizing your website - filenames, folders, subdirectories, making sense
of it all.
A note about "index.html" - this is the usual default page for websites. When you specify the name of the directory but not the page name, this is what you will get. So every directory (folder) should have an "index.html" in it, unless you want visitors to be able to see a list of the files you have in that directory.
If all you have is one page, and a few images, things are easy. You call
the page "index.html" (or index.htm) and put it and all the images in your
root directory.
But what if you have several pages, with different pictures on each, and
plan to add more from time to time? You could just put it all in one folder,
but before long you'd have a real mess to deal with.
There are probably as many ways to organize a website as there are webmasters.
I'll try to tell you some possibilities and let you decide
for yourself.
This much is for sure: In your root directory you put your main page, and
call it index.html.
Some people have a subdirectory for all their images. so whenever they call
an image for any of their pages, in any directory, that is where it is to
be found. I don't do it that way. If there are to be a lot of images on the
site, the "images" directory soon becomes an incomprehensible mess.
For Example
This domain has only 6 pages, and two images that are used on every page,
plus three additional images for each page.
This makes a total of 26 files:
6 html files
18 page-specific images
2 multi-use images
If you are really confident you won't be adding anything to the site, you
can do it all in the root directory. Your coding will be simple. Your visitors
will be able to type in your domain name and automatically see your index.html
page. And links from the index.html to the other pages can be simple relative
links - <a href=pagename.html>Click here</a> and links back can
be equally simple - <a href=index.html>Home</a>
However, you probably can't be sure you won't be adding pages to the site.
With that in mind I would usually make a new directory (folder) for each
of my 5 other html pages, and put the associated images in the folder with the
page. I would name each of the pages index.html. That can be a bit confusing
if you're not careful. So be careful if you do it that way.
So I would have the root directory containing:
index.html
2 multi-use images
5 subdirectories (each containing index.html and 3 images)
When I want to link from the main page to one of the index.html pages in a subdirectory,
I use: <a href=directoryname/>Click here</a> and linking back
to the index page can be either by an absolute link: <a href=domainname.com>Click
here</a> or a relative link: <a href="../index.html">Click here - There are
good reasons for using either way. I generally use the absolute link in that
case, but it's just my own preference.
If your site has a lot of pages related to one of your subdirectories, you may decide to make subdirectories within subdirectories. If it makes sense to you, do it.
Note that many of your links won't work right when you are testing them on your own computer, but when you load them to your website they'll be fine.