Q: How do I create my own 401 and 404 error
pages?
To create
your own customized error pages, simply follow the instructions
below. We will illustrate how to customize the 404 error message.
You can then apply the same steps to customize the 401 error
page.
1. You must first create a file named ".htaccess",
which must be in your root directory (your main directory, displayed
as a forward slash "/"). You can create this file
using File Manager 2.0.
2. Edit the ".htaccess" file, and add the following
line as the first line in the file, or on a line by itself if
you have already added other error messages:
ErrorDocument
404 /error404.html
This configures
your Web site to point to the file named "/error404.html"
when a 404 error occurs. (A 404 error means "file not found"
and will occur when someone mistypes a filename or path, but has
correctly typed your domain name.)
3. Create the HTML page that you want to display in the event
of a 404 error. Save the file using the name "error404.html",
and put it in the root directory of your Web site, just like the
.htaccess file. This file is a regular HTML file and can contain
whatever you can display on a normal HTML page, so create whatever
you want people to see when they get the 404 error. (Note: capitalization
matters. Filenames on our Web servers are case-sensitive. Your
filename must match your entry in the ".htaccess" file
exactly in order to function correctly.)
Other errors,
such as the 401 error, work the same way. To create an error page
for the 401 error, perform exactly the same steps as outlined
above, except add 401 instead of 404. For example, if you have
already done the steps above and created the ".htaccess"
file with the 404 line in it, then add another line for the 401
error. The file contents with both errors would appear like this:
ErrorDocument
404 /error404.html
ErrorDocument 401 /error401.html
You will then need to create another HTML file named "error401.html"
in the root directory to handle your 401 errors. For the curious,
a 401 error means "unauthorized access attempt" and
can occur in different contexts, such as when someone tries to
access your member area without the correct password.
|