How to use custom 404 pages
You might be surprised to hear that 404 pages will probably be one of the
most seen pages in your website! A 404 page is the page displayed if someone
tries to reach a page on your website that does not exist. All web servers like
Apache and IIS have a default 404 page that is displayed to people. Actually 404
pages are just simple HTML pages, you can change the default 404 page to a page
that displays anything you want. So instead of the common ‘this page does not
exist’ message that tells your visitors nothing, you can put up an informative
page that will help them find what they are looking for. A good idea is to take
your site-map page, and make it the 404 page for your website. Another idea would
be to make your 404 page a search page where people could search your site. And
how do you tell the web server, where your new customized 404 page is sitting?
This is something you have to ask your host do for you. Just ask them about
allowing you to do this, and they should be able to make the quick change to
their servers.
Tip one: Use contain files for repeating content
As you may already know there are lots of repeated content in a website. Things
like page headers, page footers and navigation menus come to mind. Include
files are separate pages of HTML code that contain things like the ones I just
mentioned; things that are intended to be used on many different pages; you
should use contain file for all this repeated stuff. Main purpose behind using contain
files is to save lot of time.
For example: if say you have the same menu on 30 different web pages,
include files will allow you to keep all your menus up to date on all your web
pages easily since to update all your pages, all you have to do is update the
one include file rather than all the 30 pages individually. There are many
different technologies you can use to ‘contain’ things this way; the most
common are listed here:
Alternative: 1. Server side includes using either: PHP, ASP, JSP etc
…
Alternative: 2. Using client-side includes tools like found in
Dreamweaver.
To include a file with PHP all you need to do is insert this code in your
PHP pages:
<? Include (\"mainMenu.php\")?>
Here all you have to do is name the file that you want to ‘contain’ in your
page. So in the above example the page we want to include is called
‘mainMenu.php’.
In ASP, it is very similar:
Here, the included file is in a folder called ‘contained’ and the file being
included is called ‘header.asp’
Tip two: having a site map for every web site
Both search engines and actual live visitors use site maps. They are almost
essential for just about any website because they provide an easy to use macro
view of your website. In a nutshell, a site map is essentially a categorized
page of links to all your websites’ pages. Many users will just go to a sitemap
to find what they are looking for, while search engines will ‘creep’ to your
sitemap page to index your site and that is another nice If you are interested
in SEO a site map is one of the key additions to your websites. It will not
only help finding them your web pages but also increase your ‘hits’.
Tip three: Having a steady footer
It may seem a very small thing but Page footers are not less important. We
had them in books forever. So it only makes sense to present people something
they are familiar with. But in the case of the web, you can provide a lot more
useful information in the page footer. It will make your website more user-friendly.
Some ideas include: your contact information: email address, your phone number
et cetera. Another good idea is to have a text-only navigation menu in your
footer. Nothing fancy, just a series of text links that can get people to the
major sections of your website. Sounds simple? Of course but it is very helpful
when you make your website more dependable and friendly.