About MartNet MartNet Technical Support Yet Another MartNet Ad
Home Services Support Members Software Contact
Search Support
MartNet WebMail

MartNet WebAdmin

Dialup Access

Domain Name

MartNet News /
  Status Info

NOC / System Status

Support Topics:
 MartNet WebAdmin
 Virtual Hosting
 Web Site Construction
 Unix / Linux
 Internet Chat
 Game Server Services
 Misc. Stuff
 Policies / Legal

 MartNet WebAdmin
 Virtual Hosting
 Game Server Services
 Misc. FAQ's

 Privacy and Security
 Web Development
 Unix / Linux
 Game Server Services
 Misc. Support Links

MartNet Policies
Billing Dept.

Check Domain

How to Create Custom Error Pages
how to create your own 400, 401, 404, etc.

Creating Custom Error responses for your Web Site

(such as 404 - file not found)

These instructions assume a working knowledge of using ssh (Secure Shell), your Unix Shell account, and a basic text editor such as pico. Click here for basic instructions if you are unfamiliar with using these tools.

For a listing of all Web Error Codes and their definitions, click here.

You can customize your error messages by creating or editing your .htaccess file (pronounced dot-h-t-access. There is a "period" at the begining of the file name.) But first you need to create the following html documents, which is what will be sent to the user's browser in place of a standard error message:


You can word the contents of these documents however you please. You are not limited to .html files for your error response documents (for example, you can use a .shtml file, and use Server Side Includes to create customized error responses.) You are limited only by your imagination!

Now comes your .htaccess file. Inside your public_html directory, or one of its subdirectories, you may have a file named .htaccess. If an .htaccess file isn't already there, then you can either create one online using the pico command in your Unix shell, or create one in a text editor and upload it to the server using an ftp program. Now add the following lines to your .htaccess file.

ErrorDocument 400 URL
ErrorDocument 401 URL
ErrorDocument 403 URL
ErrorDocument 404 URL
ErrorDocument 500 URL

Make sure to replace where it says URL with the full URL to that error message. For example, your .htaccess file may look something like this:

ErrorDocument 400 /~username/400.html
ErrorDocument 401 /~username/401.html
ErrorDocument 403 /~username/403.html
ErrorDocument 404 /~username/404.html
ErrorDocument 500 /~username/500.html

You also have the option of just puting in the text or HTML to display in your .htaccess file (although we recommend creating a nice, custom page.) For example:

ErrorDocument 404 

404 Error: File not found

That's it! Users should now see your custom error pages instead of boring, cut and dry Web Error messages if they ever encounter a problem!

This Web Site is proudly built upon an Open Source foundation:
Assembled with PHP Powered by Debian Linux Fueled by MySQL
Served by Apache

Home | Services | Support | Members | Software | Contact

MartNet - PO Box 42472 Philadelphia, PA 19101
Copyright 1996 - 2015 MartNet Communications LLC. All Rights Reserved.