State Library of Victoria Logo
| About | Help | Members | Products |

VICNET Help is open from
9am - 5pm weekdays
(except public holidays)
Call Us: 8664 7001
Toll Free: 1800 629 835
Fax: 9639 2175

Library & Broadband Customers with 24hr Support please call the direct paging service immediately to report any outages.

Shortcuts

Help With

Online Help

Web Design: Custom Apache Error Pages

Note: Custom Error Pages are available for Virtual Web Server (VWS) Customers only.

When someone tries to access a file that does not exist on your site, normally they'll get a page that looks like this:

If they are using a recent version of Internet Explorer they may see Microsoft's so-called 'friendly' error message pages, which look like this:

Arguably neither version looks particularly professional or is very helpful to anyone viewing your Web site.

If you have recently reorganised your site, and there is the chance that people have bookmarked pages that no longer exist, or you have password restricted areas on your site, it is probable that viewers of your Web site may come accross an error message. Thankfully Vicnet Virtual Web Server (VWS) customers have the option of using custom error pages on your Web site. Here's how to do it:

  1. Create 4 Web pages containing your own Web site's look and feel, along with appropriate error message explanations for the 4 most common errors viewers can encounter:
    • HTTP error code 401 - Authorization Required
    • HTTP error code 403 - Forbidden
    • HTTP error code 404 - File Not Found
    • HTTP error code 500 - Internal Server Error
  2. Using an FTP program such as FileZilla, upload these files to your Web space in ASCII or TEXT mode
  3. Open your favourite plain text editor such as Notepad (using Windows) or SimpleText (Apple Macintosh) and create a new file named htaccess.txt Alternatively if you have already password protected your Web site, open your existing htaccess file.
  4. Within your htaccess.txt file, type the following:
  5. ErrorDocument 401 pathTo/authorization_required.htm
    ErrorDocument 403 pathTo/access_forbidden.htm
    ErrorDocument 404 pathTo/file_not_found.htm
    ErrorDocument 500 pathTo/internal_server.htm

  6. Replace the pathTo/ portions with the address to your new custom error pages. e.g. if you have uploaded your HTTP error code 404 - File Not Found page to an errors folder, replace pathTo/ with /errors/, leaving you with:
  7. ErrorDocument 404 /errors/file_not_found.htm

  8. Using an FTP program such as FileZilla, upload these files to your Web space in ASCII or TEXT mode
  9. Rename the file from:
  10. htaccess.txt

    to

    .htaccess

    i.e. Nothing should precede the "." and there should not be any filename extension such as .txt or .doc

You should now have custom error pages!