|
Question
Daniel writes:
"How do you create custom 404 error documents" ?
Answer
03/28/00
This can be done with the .htaccess file. .htaccess
is a regular text file that contains "scripts" that allow
you to override certain things on your server - like creating a
custom 404 error document that replaces the server's default 404
document.
To be able to create your own 404 error document, first you need
to create the actual document (use your HTML editor of choice or
hand code it if you like), upload the document to the root directory
on your server, and finally include the following in your .htaccess
file:
Note that first you must name (save) the file as htaccess.txt
in your local hard drive, then once you upload it to your server,
you must rename the file to .htaccess - the file doesn't
have an extension nor it has anything (a name) before the dot (.).
Also, once you rename the file, it will disappear - well, you just
won't be able to see it because it's a hidden file (files preceded
with a dot (.) are hidden in UNIX).
The .htaccess file can allow you to do many other things
such as enabling HTML files to be parsed for SSI code, preventing
bandwidth theft, referring, etc. For more info you can check out
the Apache docs at Apache.org.
Also, remember that some server administrators setup their servers
so that they do not process .htaccess files.
|