WebBuilder101 - Making the web happen!
Need Web Dev software? Here is the place to
Flash Point
.htaccess and custom 404 documents

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:

  • ErrorDocument 404 http://www.yourdomain.com/404.html

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.

.

 

More Resources
What is SSI?
SSI and Browser Cache
Creating a Text file

Suggested Reading

Beginning Active Server Pages 3.0
JavaScript Bible
Red Hat Linux
Dreamweaver 3.0
HTML Bible



Download WB101 Wallpaper
• Web Builder 101 Wallpaper Get it!.
• Find out how to create your own Wallpaper Teach me!.
Sign up for our Newsletters
• Web Building Sign me Up!.
• Net Alert! Sign me Up!.
Need Help?
• Contact Support Click here.
• E-mail the Webmaster Click Here.
• Search Tips Click Here.

Webbuilder101.com © 1998 - 2003 Copyright and Terms of Use
Send mail to: webmaster@webbuilder101.com

» About » Support

» FAQ » What's New » MyLog

Web Builder 101 Web Builder 101 - Making the Web Happen Web Builder 101 - Making the Web Happen
.