Making a custom error page with DreamHost is easy. DreamHost servers have built-in special file names that, if present in your domain’s root directory, will load automatically when a visitor gets a particular error message on your website.

Here are the special file names:

failed_auth.html - for Error 401 - Failed Authorization
forbidden.html - for Error 403 - Forbidden
missing.html - for Error 404 - File Not Found
internal_error.html - for Error 500 - Internal Server Error

For instance, if you wanted to make a custom 404 error page, create a file called missing.html and place it in your site’s root directory. Edit missing.html to look and include anything you wish.

Why would you want to create custom error pages?
Instead of a visitor getting a generic 404 File Not Found Error, you could make a custom 404 page that shows your sitemap and/or offers a search form. Now you are re-directing that lost visitor back to your content.

Notes: When creating links on your custom error pages…make your links absolute rather than relative.
In other words, use something like: a href=”http://mydomainatDH.com/mypage.php” rather than ../mypage.php

Advanced users may wish to create custom error pages the old fashion way, via .htaccess — but we will cover that in a future tutorial.

You can also turn off this feature by editing your .htaccess file to include the following lines of code:
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

For more info see: the DreamHost Wiki

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • Ma.gnolia
  • StumbleUpon

One Response to “Easy Custom Error Pages at DreamHost”  

  1. 1 VBun

    It seems easy enough, but I don’t know what it means by “domain root directory”…

Leave a Reply



About DreamNut

DreamNut is an unofficial DreamHost blog with hints, tips and video tutorials.

Use DreamHost promo code MAXSAVINGS at Dreamhost to get up to $50 off DreamHost web hosting.


Archives

Social Bookmarking