Simple Website Maintenance
Allowing easier website maintenance
with a structured page naming style
 |
Article
by
Steve Watkins |
Introduction
Making and maintaining a very small and simple website
is a very simple process. Making and maintaining a large and successful
one is not. In this article I will explain a few of the basic tips and
tricks that professional web developers use to keep their sites easy to
update and error free.
While on most small sites these hints will not usually
save you much time, even if your site grows to more than ten pages you
will be glad you followed a set page naming structure.
Keeping these suggestions in mind when first developing
your site is vital. Ignore them now and it will cost you in maintenance
time later.
Capitalisation of page and image names
The key when naming both your page file names and image
file names is consistency. Use a regular scheme like always
making your file names lower-case, or upper-case, but never a mixture
between the two.
This is especially important on a Linux based website
hosting server like us. Unlike Windows, Linux is case sensitive. While
your Windows computer might show your pages correctly when you link
using different capitalisation, when you upload your site you will have
errors.
Having a fairly simple naming convention like "always
keep file names lower case" can save you significant amounts of time
when you search for the reason why your images are not displaying
correctly on your site. The same applies when looking for why one page
doesn't link correctly to another.
Separating words in a filename
While wherever possible it is best to keep the
filenames of your pages and images to one word, sometimes for their
easy identification two or three words is necessary. In this case,
developers are well advised to use a multiple-word naming convention as
well.
While you could use spaces between the words,
this can be another major source of errors appearing. The reason why
using spaces is not recommended is that many programs you and your
visitors use do not handle them properly. The files may appear as
missing because of the spaces.
Instead of spaces you have a few other options for a
file you would have named "page name.html":
- No Spaces - You could name file pagename.html, but
this could be a little confusing without something clearly separating
the two words.
- Underscores - You could name the file page_name.html,
which is a good style.
- Hyphens - You could name the page page-name.html,
which also has the benefit of search engines being able to separate the
words. The search engines may rank you slightly higher with this naming
method.
Avoiding file overload with structured directories
While following an established file naming convention
will have removed many of the potential errors for your site, to make
maintenance as easy as possible files should be stored in directories.
Once again, you could place every page and
image in one big collection in your public_html directory. The problem
with this method is that once your site grows you may find your files
here more than can be easily managed.
It is much smarter to use separate directories for each
of your pages depending on their content. For example, with our site,
we currently have more than eighty FAQ pages, and several pages simply
listing which questions each of these pages covers.
Instead of having every one of these in the public_html
directory, we have created a "FAQ" sub-directory below the public_html
one. We place our pages with lists of FAQs here. Below the FAQ
directory we use "answers" for the actual FAQ answer pages themselves.
While this is a fairly simple example of having a
directory structure, as you add more pages it will help considerably in
keeping your site organisation clean and clear.
Conclusion
At the end of the day, your file naming conventions and
directory structure is a personal preference that should be customised
to your particular site and developers. No matter which you actually
implement, keeping things consistent will save you time and help reduce
errors over the long term.
See further general
website hosting FAQs or our FAQ categories
for more information.
Please contact
us if you have a question that is not answered on our site.
Other Frequently Asked Questions Categories
|