BigNoseBird.Com- home Small Logo
The 508 compliant Guide to 
       Big Nose Bird
BACK
WARNING: Be very careful editing your server configuration or .htaccess files. Even a minor typographical error can make your site unusable! Always make a backup copy of any file so you can recover quickly.

Redirecting Your Reader to Special HTML Pages when an error occurs.

Rather than showing a simple text message when an error occurs, displaying a friendly message along with a link to follow back to a real page is a nice touch. I suggest that you keep the message brief and polite. Do not consider every user caused error some type of intrusion attempt. Anyone poking around with any knowledge of how a server works will realize that you are properly handling and possibly monitoring such activity.

To redirect a reader to a special web page when they encounter an error, you can either modify the srm.conf file if you have the ability to do so, or to modify your .htaccess file.

In the srm.conf file you will find a line that looks like this:

#ErrorDocument 404 /missing.html

To specify a special web page, simply remove the # mark and create a document called missing.html in your main HTML directory.

ErrorDocument 404 /missing.html

You can name the files whatever you wish, and you might consider placing all of them in a special directory. I have never tried running the server configured for URL redirect without first creating the error documents. Who knows what would happen if the missing file was itself- missing!

If you do not have access to the master system files, you can add the line as shown above to your .htaccess file. In order for this to work, the system administrator must make certain that the AllowOveride option called FileInfo is set. You should try to obtain AllowOveride All on your directories.

You can of course have a special file for each error code:

ErrorDocument 400 /errors/badreq.html
ErrorDocument 401 /errors/noauth.html
ErrorDocument 403 /errors/forbid.html
ErrorDocument 404 /errors/missing.html
ErrorDocument 500 /errors/conferr.html

You can also redirect people off of your site using an external URL.

ErrorDocument 403 http://www.fbi.gov/
It's up to you if you want to send people accessing forbidden URLs to the FBI!



Find or Give Help on the BBS
 
Home Top E-Mail
If it looks great, it's by Christine
Some Fine Print
© 1997-2003 BigNoseBird.Com®, Inc. All rights reserved. All other trademarks are the sole property of their respective owners. The products that we recommend are only ones that we use. We have no relationship with any of the authors or their companies. We cannot assume responsibility for their ultimate performance or lack of same. We also cannot assume responsibility for either any programs provided here, or for any advice that is given since we have no control over what happens after our code or words leave this site. Always use prudent judgment in implementing any program- and always make a backup first! For further information, please read our Privacy Statement. We can be contacted at webmaster@bignosebird.com.


<reallybig.com>
Web Builder Network Portal
Advertise
on the
Reallybig.com
Network
BigNoseBird Newsletter
Subscribe
Un-Subscribe


Sign up today to receive our low volume newsletter. Tips, tricks, news, and whatever else crosses our minds.
Back Issues
Privacy Statement