≡
  • Home
    • About Us
    • Site Map
  • Resources
    • Resources for Website Design
    • HTML Document Structure
    • Genealogy Web Site Design
      • Planning a genealogy website?
      • Organize your genealogy website
      • Creating a New Website
      • Customizing Your Website
      • Publishing your Genealogy Website
      • Maintaining Your Genealogy Website
    • Publishing With FTP
    • RootsWeb WorldConnect Project
    • Validation Tools
    • Browser Web Developer Toolbar
    • Website Design and Search Engines
    • Saving and Using a Complete Web Page from the Internet
  • Articles
    • Snagit and Genealogy
    • Top 10 Genealogy Mistakes to Avoid
    • Quick Tips for Beginner and Amateur Web Designers
    • Tennessee Family Bible Records
  • Tutorials
    • Tutorials & Articles
    • Add Search Box
    • Converting a Theme Based Site to DWT
    • Converting a Table Based Layout
    • Create custom Error Pages
    • Create 301 Redirects
    • Creating a New Website
    • Creating a FrontPage Web
    • Create a Gradient Image
    • Creating Layered Backgrounds
    • Creating A Navigation Menu
    • Creating Website Navigation
    • Heading Tags - <h1> to <h6> tags
    • Server Side Includes
    • www versus non www
    • Using Bordered Backgrounds
  • Templates
    • Fixed Width Templates
    • Mobile Friendly Templates
    • Liquid Layout Templates
    • Christmas CSS Layout Templates
    • Instructions for Using Templates
  • Contact

How to create custom Error Pages

NOTE: The ability to create custom error pages is only available if you have a paid hosting account. Free accounts do not usually allow this.

Hosting companies provide tutorials on how to do this. Just Google "custom error pages" + Your host name.

  • Bluehost Web Hosting Help Error Pages
  • Set a custom 404 page in my Linux Hosting account

Create a custom error page on 1and1 Linux Hosting

If you are hosting your site on 1and1's Linux servers, there are three ways you can use to create custom error pages.

By creating error files

The easiest way to create custom error pages is to create the page and give it one of the following names depending on the error page you are creating:

  • error403.html  (Forbidden You have requested to view a web page or directory to which you are not allowed.)
  • error404.html  (404 Not Found The web page you requested cannot be found on the web server.) This is the most common error page you will create.
  • error500.html  (Internal Error There’s something wrong on the web server and it cannot process your request or update.)

The files would then be uploaded to the directory where your particular domain resides. If you are hosting multiple sites on your server space, this is NOT the root directory.

EXAMPLE: My site genealogy-web-creations.com points to a folder genealogy-web-creations. I upload the error pages to the folder genealogy-web-creations.

If you have an external style sheet attached to your error page, you should link to the absolute url http://www.my-domain.com/my-stye-sheet.css. If you don't and your page may not display as expected for pages not located in your root directory.

You can test to see if your page works by typing in your url http://www.your-domain.com/any-file-that-does-not-exist.html

By creating a ".htaccess" file:

Step 1: Create the HTML page you want to use as your error message and upload it to your home directory (the directory where your domain resides.)

Step 2: Create a .htaccess file (using NotePad or a similar program) and add these lines which specify the substitution.

EXAMPLES: 

  • ErrorDocument 403 http://www.your-domain.com/403.html
  • ErrorDocument 404 http://www.your-domain.com/404.html
  • ErrorDocument 500 http://www.your-domain.com/500.html

Step 3: Upload the .htaccess file into your home directory (the directory where your domain resides. You will not see it once uploaded since it gets hidden by the server. When you are transferring the files, make sure you choose ascii as the transfer type. NOTE: If you already have an .htaccess file, just add the lines to the file that already exists. Using a .htaccess file does not work for PHP files.

Step 4: You can test to see if your page works by typing in your url http://www.your-domain.com/any-file-that-does-not-exist.html

By adding this piece of code in the .htaccess file

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /errordocument.html

Create a file named "errordocument.html" containing your error message content. Upload the document to the directory where your domain resides.

NOTE: I have used the first two methods but not the last one.

Planning a Genealogy Website 2nd Edition is available as a 42 page EBook in pdf format for you to download. It has been totally revised and updated with new content. The EBook is zipped for faster download. Save it to your desktop, extract the file and it is ready to use.

Microsoft MVP.
April 2007 - April 2013


Disclosure: This is an affiliate link, which means that if you visit Bluehost.com through this link and purchase this product, I’ll get a commission.

Microsoft® and FrontPage® and Expression Web® are registered trademarks of Microsoft® Corporation.

Genealogy Computer Tips | Expression Web Tutorials & Templates