(Answer) (Category) PRW.NET FAQ's : (Category) Web Hosting :
Can I display a message to my visitors when a page is not found ?
Yes. You can redirect your visitors to a certain page when an error occurs, including page not found (error 404) and internal server error (error 500, generally caused by a problem on a cgi script). On sites hosted with Linux/Apache just add two lines to the ".htaccess" file on your "html" directory similar to these examples:

  ErrorDocument 404  http://www.mydomain.com/not_found.htm
  ErrorDocument 500  http://www.mydomain.com/cgi_error.htm
This can be useful to handle broken links, scripts that are being tested, etc. Instead of getting a generic error message, the visitor will get the page you specified.

NOTE: Be careful not to change existing lines on the ".htacess" file since that may affect other functions such as the Frontpage extensions.
2002-Sep-16 6:34pm
Previous: (Answer) How can I add a counter to my pages ?
Next: (Answer) Can I use a database on my site ?
This document is: http://www.prw.net/cgi-bin/fom?file=119
[Search] [Appearance]
This is a Faq-O-Matic 2.721.

Please send any suggestions, comments or problem reports to our webmaster
(C) 1999-2007 PR WebMasters