Table of Contents
 Home
 About this Tutor
 Introduction
 HTML Editors
 Basic Code
 Utter Basics
 The Body Tag
 Headings
 The Font Tag
 Images
 Tables
 Tables Part Two
 Tables Part Three
 Nesting Commands
 Some Design Tips
 Meta Tags
 Web Hosts
 Uploading Your Site
 Copyright Issues
 HTML Mail Lists
 Future of HTML
 Marketing
 Style Sheets
 CSS and Text
 CSS and Fonts
 CSS and Cursors
 CSS and Backgrounds
 CGI
 CGI Scripts
 JavaScripts
 Affiliate Programs List
 Browsers
 Dang 404 Errors
 Dang 404 Errors
 Color Chart One
 Color Safe Chart
 Color Chart Three
 Code Chart
 Arial Character Map
 Times Character Map
 Wing Ding Character Map

 Meta Tag Generator
 BBS Forum
 Contact Us
 Glossary
 SiteMap
This Site Has Been Rated:
Rating = 7.69By 180 Users
Please Vote Here:
Eventually I'm going to charge for access to this site. Probably around $30 yearly. Right now you can get in on the ground floor with this pre-launch offer. For $6.97 you get Unlimited Lifetime Access. Take advantage of this time limited offer click the button below.

Those Darn 404 Pages

Oh geez. What to do. I used to have a page called widgets.html bit I renamed it to widgets.shtml to add a counter and now ... I've come to find out that it's been indexed at Google and I have lost 12,565 visitors 'cuz the damn page doesn't exist! What to do?

Well, this is a common problem. Renaming pages, deleting pages, reworking your site and realizing that you don't need pages. It happens, and it happens all the time. Just remember when you are renaming or deleting a page that it may well be indexed by some engine somewhere (it probably is) and you won't get any traffic from that link if you don't have a page there.

So, in comes the .htaccess file and the Error Handler Coding you can use with an Apache set up server. If you've come along in this tutor so far with me, you have gone the Linux/Apache route and you will be all set with this in a few minutes.

What we are going to do is set up a page that everyone will land on when they either make a typo in the URL they typed in, or they land on a page that you have deleted or renamed. We'll use the .htaccess file and we'll create an error file. Here is the code for the error file, which I call oops.shtml.

<HTML>
<HEAD>
<TITLE>oops ... get lost?</title>
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<META NAME="generator" CONTENT="NoteTab Pro">
<META HTTP-EQUIV=REFRESH CONTENT="5;URL=http://www.htmlguide.us">
</HEAD>
<BODY>

<center>
<font face="verdana, arial">
<h2>oops ... I think you got lost</h2>

<h3>We'll return to you our Home Page<br>
and you can try again from there</h3>
</font>
</center>

</BODY>
</HTML>

Copy/paste the above code into a file and call it oops.shtml (or whatever else you want to call it). Change the URL to your URL, that is whatever your domain is, and whatever your page is called. Now upload that file to your server in the same directory as you have your index.shtml page

Now the .htaccess file probably doesn't show up on your server. Go to your main directory, the one where you put your index.shtml file, and see if you see it there. It should be the first file listed called simply .htaccess ... you probably don't see it. It is probably there though. Several years ago most hosting companies changed several important files on the servers to hidden. They exist, are there, can be replaced, but are hidden. They did this so bozos wouldn't delete them thinking they were nothing anyone needed. Now do this from WS_FTP ... click on the arrow that points to the left window to download a file from the server to your PC. A box will popup. Type .htaccess into that box and click on OK. That will send the file to your PC. Now open that file up in NoteTab and add this one line to it:

ErrorDocument 404 http://www.htmlguide.us/oops.shtml

Well, OK, don't add that line exactly, otherwise your users will wind up at my site, which is perfectly OK with me, but probably not with you. So, change my URL to your URL of whatever page you want to display when the user would of seen a 404 Error page.

Also if you wish to, you can change the meta refresh line above to a longer or short time. To to the code above; META HTTP-EQUIV=REFRESH CONTENT="5; and change that 5 to a larger number, for a longer delay before redirecting to the defined page, or a lower number to more quickly redirect to another page. Matter of fact, the oops.shtml page doesn't really need to have any content in it at all, you could just have it direct immediately and no one would ever really see that page. Either way is fine. I've shown you this way, as it's what I use, but I truly hope everyone isn't just like me ... it would be an extremely boring world.

Now upload that file to your site in the same directory as you have your index.shtml page.

That's it! Now whenever someone lands on a 404 Error page at your site they will go to the page you just uploaded. You can do well with this. Try replacing oops.shtml with your sitemap.shtml file. When someone gets lost they will be able to easily find their way back to where they were.


<


© Copyright Night Train Web Productions Night Train Web Productions — All Rights Reserved
No Part of This Work May be Reproduced by any Means Without Prior Written Authorization
8153 / 051006 / 301773