Welcome, Guest

Please login or register

TUTORIALS SUBMENU

PHOTOSHOP    FLASH    ILLUSTRATOR    BLENDER    CINEMA 4D    WEB-CODING

Related Links

Custom Error Messages


It is a fact of life that if you run a busy regularly-updated website you'll also move your files about quite often. Whilst this may not pose a problem for you initially, search engines take a while to process dead links, and during this time you may be losing visitors who go to your old pages and get the standard 'page not found' error. You can prevent this by customizing your error pages, sending your visitors instead to a nice formatted webpage that politely tells them to keep on looking using your new navigation structure.   There are two ways to do this...

Apache Configuration
If you are lucky enough to have a decent web hosting service that gives you access to Apache's httpd.conf file, you can set up custom error messages in a matter of moments.  Just open up the file in your favourite text editor, search for ErrorDocument 404, uncomment out the line, and add the URL to the file on your website containing the error message.   You should end up with a line looking something like this:

ErrorDocument 404 http://www.yourdomain.com/404error.htm

Now save your changes, upload the amended file, and restart Apache.  If all goes well, you'll now be redirected to your error page if you enter in an incorrect URL on your server.    If you have IIS or any other webserver, access your documentation for details on how you do this for your service.

.htaccess Configuration
Even if you don't have direct access to the Apache configuration files, all is not lost. A virtually identical effect can be achieved using local .htaccess files.   Just use your favourite text editor to create a file called .htaccess (if you use notepad, beware it doesn't add a .txt extension onto the end) that contains the following code:

ErrorDocument 404 http://www.yourdomain.com/404error.htm

Notice anything familiar? :)  Now upload the file to the main directory of your website, or the specific subdirectory you want to protect.  Remember that the settings in this file will affect any directory you put it into and all subdirectories branching off from it, but not any parent directories.  Also make sure you upload this file in ASCII and not binary, and CHMOD it to 644 or you'll run into problems. If you don't know how to CHMOD, just download a decent FTP program like CuteFTP, right click on the file, and select 'change file attributes' or somesuch - that does the same (essentially it just allows the file to be readable by the server but not by any joe public with a browser).   And that it!  No reset is needed, so you should be able to see your changes immediately.

Other Configurable Errors
Although 404 (page not found) errors are by far the most common ones you will see on the internet, there are quite a few others that can be handled using exactly the same methods detailed above. Just in case you ever wanted to know, they are...
 

Client Side Errors Server Side Errors
400 Bad syntax
401 Unauthorized
402 Not Used
403 Forbidden
404 Not Found
500 Internal Error
501 Not Implemented
502 Overloaded
503 Gateway Timeout

- Tutorial written by Man1c M0g

Automatic Translations: Translate Into French Translate Into German Translate Into Italian Translate Into Spanish Translate Into Portuguese

Last 5 User Comments

User:  robin746 (#27064)
Date: Tue May 02, 2006. 20:24:20

Post #1 of 1

Glad you mentioned the other error codes, as people seem to do 404 and then stop there.

For loads of fun, visit [link] to see how creative people have gotten with their pages. Hours of fun!

Reply to this post


--- View Entire Thread ---
Featured Tutorialsmore

Fancy Stars
Fancy Stars
- Adobe Illustrator -
Flower Patterns
Flower Patterns
- Adobe Photoshop -
Animated Fire
Animated Fire
- Adobe Photoshop -
Sudden Seasonal Ch...
Sudden Seasonal Ch...
- Adobe Photoshop -
Membership

Username:
Password:  
Remember Me

Lost Password? || Register

Related Links

Special Options
Printer Friendly Version
Forum Threads

New Sheriff Wanted
Author: skates1
Posted: Mar 06th, 7:49pm
Activity: 0 replies, 102 views
Graphics and artwork remixing/collaborating web...
Author: artremaster
Posted: Mar 04th, 6:21am
Activity: 0 replies, 161 views
grafpedia(.com)
Author: tichnak
Posted: Mar 02nd, 10:54pm
Activity: 3 replies, 205 views
Hockey?
Author: stiney51
Posted: Mar 02nd, 2:39pm
Activity: 3 replies, 182 views
I am Back Guys!
Author: LaFleureRouge
Posted: Feb 27th, 6:09pm
Activity: 9 replies, 298 views
Banknote Design
Author: tichnak
Posted: Feb 27th, 4:50pm
Activity: 0 replies, 230 views
New Design & Font System!
Author: Man1c M0g
Posted: Feb 27th, 10:26am
Activity: 1 replies, 254 views
Domain Developers Fund
Author: tichnak
Posted: Feb 24th, 11:23pm
Activity: 7 replies, 335 views
WIP - AlexStanford.com
Author: ahstanford
Posted: Feb 24th, 2:37pm
Activity: 5 replies, 257 views
How do you make good repeating-image patterns?
Author: Mars
Posted: Feb 17th, 7:38pm
Activity: 1 replies, 407 views
Mech projects
Author: Culann
Posted: Feb 14th, 9:46pm
Activity: 5 replies, 441 views
I'm Back...
Author: ahstanford
Posted: Feb 14th, 2:01pm
Activity: 1 replies, 353 views
Forum Threads

--- Site Resources ---
Total Tutorials:212
Total Downloads:    417
Total Fonts:    4673